Reputation: 106
There are 4 tabs on a particular URL and the first one is marked active by default. I want to get another tab in an active state on the occurrence of a particular event while getting redirected to this URL.
I've already tried solutions like:
$('[href="#transaction_history"]').tab('show');
$('.nav nav-pills nav-stacked a[href="#transaction_history"]').tab('show')
$('.nav-stacked > .active').next('li').find('a').trigger('click');
$('.nav-stacked li:eq(2) a').tab('show')
None of these have worked for me.
Upvotes: 0
Views: 280
Reputation: 4533
You have to manage this via flag. and based on that you have apply class dynamically.
[ngClass]="{'active':tab == 'xtabName'}"
Upvotes: 1