In my application, there are 3 tabs set up as follows:
<li ng-class="{ active: isActive('#one')}"><a data-toggle="tab" class="tab-txt-color" href="#one" ng-click="selectTab('fruits')">Fruits</a></li>
<li ng-class="{ active: isActive('#two')}"><a data-toggle="tab" class="tab-txt-color" href="#two" ng-click="selectTab('veggies')">Veggies</a></li>
<li ng-class="{ active: isActive('#three')}"><a data-toggle="tab" class="tab-txt-color" href="#three" ng-click="selectTab('decors')">Decors</a></li>
Code in .js file:
$scope.isActive = function (viewLocation) {
return viewLocation === $location.path();
};
When a tab is clicked, it becomes highlighted.
I have added previous and next buttons to each tab's content. How can I make the respective tab active when clicking on the previous button?
<div>
.......
......
....(content of Veggies tab)
[At the end of this tab, there are 2 buttons]
<div class="col-md-12 col-lg-12" style="margin-top:20px;" align="right">
<a href="#"><img src="core/static/images/previous-btn.gif" border="0" ng-click="selectTab('fruits')"></a>
<a href="#"><img src="core/static/images/next-btn.gif" border="0" ng-click="selectTab('decors')"></a>
</div>