'Nav-tabs prev button on Angular Bootstrap

first question here. I have a program runing on Angular 11 with Bootstrap 4.1.3. I'm trying to make a button that returns to the previous nav-tab the user was seeing, or just a button that directly goes to the previous/next tab would be ok too. The code i'm using creates a button that does nothing on click. At this point i've tried everything i could find around the internet but nothing seem to work. And also, i a beginner using Angular/Bootstrap. So, what i'm doind wrong? Someone can help me?

    <ul class="nav nav-tabs pl-1">
      <li class="nav-item active"><a href="#home" data-toggle="tab" role="tab" class="nav-item nav-link" (click)="exibirAba('TAB1')">TAB1</a></li>
      <li><a href="#Dashboard" data-toggle="tab" role="tab" class="nav-item nav-link" (click)="exibirAba('TAB2')">TAB2</a></li>
      <li><a href="#Planilha" data-toggle="tab" role="tab" class="nav-item nav-link" (click)="exibirAba('TAB3')">TAB3</a></li>
    </ul>
    <a class="btn btn-primary btnPrevious">Back</a>
    $('.btnPrevious').click(function() {
     const prevTabLinkEl = $('.nav-tabs .active').closest('li').prev('li').find('a')[0];
     const prevTab = new bootstrap.Tab(prevTabLinkEl);
     prevTab.show();
    });


Sources

This article follows the attribution requirements of Stack Overflow and is licensed under CC BY-SA 3.0.

Source: Stack Overflow

Solution Source