I'm currently working on implementing AngularJS to show the tab number when a specific tab is selected using the controller method. However, it's not working as expected. Any assistance on this issue would be greatly appreciated.
HTML
<body ng-app="coolApp">
<section ng-controller="panelSelector as panel">
<ul class="nav nav-pills">
<li ng-class="{active:panel.isSet(1)}"><a href ng-click="panel.setTab(1)">Concert Band</a></li>
<li ng-class="{active:panel.isSet(2)}"><a href ng-click="panel.setTab(2)">Ceremonial Band</a></li>
<li ng-class="{active:panel.isSet(3)}"><a href ng-click="panel.setTab(3)">191st Jazz Combo</a></li>
<li ng-class="{active:panel.isSet(4)}"><a href ng-click="panel.setTab(4)">Brass Ensemble</a></li>
<li ng-class="{active:panel.isSet(5)}"><a href ng-click="panel.setTab(5)">Celtic Fire</a></li>
</ul>
<p> The tab number displayed is: {{tab}}</p>
</section>
</body>
Code
var app = angular.module("coolApp", []);
app.controller("panelSelector", function(){
this.tab = 1;
this.setTab = function(tabChoice){
this.tab = tabChoice;
};
this.isSet = function(checkTab){
return this.tab === checkTab;
};
});