javascript - how to to make first tab active when I have static tab angularjs UI -
just want ask if have static tab dynamic created tabs. want make first tab of created dynamic tabs selected "active" default. tried using active select last tab code
<tabset> <tab active="tab.activate" data-ng-repeat="tab in countytabs" heading="{{tab.countyname}}" data-ng-click="tab.activate = true;activatedepartmentgroupandselectbuttonsettingforcounty(tab)" select="selectalluserbycounty(tab.countyid)"> </tab> <tab heading="queue extensions"> <div data-ng-include="'/app/reception/queueextensions.html'"></div> </tab> </tabset>
this unclear how data set in controller, it's difficult point error listed part of code looks good.
i have simulated situation in plunker , working code looks like:
// in controller $scope.tabs = [ { title:'dynamic title 1', content:'dynamic content 1', active: true }, { title:'dynamic title 2', content:'dynamic content 2'} ]; // on view <tabset> <tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active"> {{tab.content}} </tab> <tab heading="static title">static content</tab> </tabset>
Comments
Post a Comment