I have two tabs and need to change tabs by clicking a button. I usually work with routes, but in this case I need to change only the tab on the same webpage.
I have the following Tabs, TAB 1 and TAB 2. Considering that I am in TAB 1, what would be a possible way to go to TAB 2 by clicking the GO button?
I use Angular 2 and the Ng-bootstrap tabs.
NOTE: I can not use JQuery.
<ngb-tabset>
<ngb-tab title="TAB 1" id="tab1">
<ng-template ngbTabContent>
<div class="tab-pane active" id="litaDados" role="tabpanel">
<form method="post" id="dados" class="form-horizontal">
<a class="btn btn-secondary"><i _ngcontent-c1 class="fa fa-plus" aria-hidden="true"></i> ABA 1</a>
<div class="form-group">
<p>ABA 1</p>
<button type="button" title="GO" click="go()" </button>
</div>
</form>
</div>
</ng-template>
</ngb-tab>
<ngb-tab title="TAB 2" id="tab2">
<ng-template ngbTabContent>
<div class="tab-pane active" id="litaDados2" role="tabpanel">
<form method="post" id="dados2" class="form-horizontal">
<a class="btn btn-secondary"><i _ngcontent-c1 class="fa fa-plus" aria-hidden="true"></i> ABA 2</a>
<div class="form-group">
<p>ABA 2</p>
</div>
</form>
</div>
</ng-template>
</ngb-tab>
</ngb-tabset>