0
I have two tabs and I need to change tabs by clicking on a button. I usually work with routes, but in this case I need to change tab only, on the same web page.
I have the following Tabs, TAB 1 and TAB 2. Whereas I am on TAB 1, what would be a possible way to go to TAB 2 by clicking on the button GO?
I use Angular 2 and Ng-bootstrap tabs.
NOTE: I cannot 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>