I have multiple sub-menus on my Manage Profile page. The issue I am facing is that when navigating from a different page to a specific menu, such as Change Password or Payment Gateway, the default active tab is not being set properly. I need some guidance on how to resolve this.
Current Page:
<ul class="nav nav-pills nav-justified" >
<li class="tablist" ng-class="tab === 1? 'active' : ''">
<a ng-click="changeTab(1)" style="cursor: pointer;"><b>MANAGE PROFILE</b></a>
</li>
<li ng-class="tab === 2? 'active' : ''" style="border-left: 1px solid white; border-right: 1px solid white;">
<a ng-click="changeTab(2)" style="cursor: pointer;"><b>CHANGE PASSWORD</b></a>
</li>
<li ng-class="tab === 3? 'active' : ''">
<a ng-click="changeTab(3)" style="cursor: pointer;"><b>PAYMENT HISTORY</lt;b></a>
</li>
</ul>
JS:
$scope.tab = 1;
$scope.changeTab = function(idx)
{
$scope.tab = idx;
};
app.js:
.when('/manageProfile', {
controller: 'ManageProfileController',
templateUrl: 'view/manageProfile.view.html',
controllerAs: 'vm'
})
Profile.html
<li><a href=#/manageProfile>ManageProfile</a></li>
<li><a href =#/manageProfile>ChangePassword</a></li>
How can I ensure that the Change Password tab is automatically set as active when selected in the profile page?