I am working w/ Angularjs. i am using Tabs and accordion directives. When tab's disabled and active properties are set to true, tab's content is not showing up. Here is my plunker snippet that reproduces the issue. Click on PL item and click on Mode 1. The Mode tab will become active and but not shown. I have a gut feeling it is due to ng-include but do not see why ...
Index.html
<div ng-controller="LeftPaneCtrl">
<tabset>
<tab ng-repeat="tab in leftPane.tabs" heading="{{tab.title}}" active="tab.active" disabled="tab.disabled">
<div ng-include="tab.content"></div>
</tab>
</tabset>
</div>
</body>
Modules.Html:
<accordion close-others="true">
<accordion-group heading="{{module.displayName}}" ng-repeat="module in leftPane.modules">
<div ng-repeat="mode in module.modes" >
<a style="color: green" ng-click="leftPane.selectMode(module, mode)">{{mode.title}} </a>
</div>
</accordion-group>
</accordion>
Srcipt.js:
function LeftPaneModel() {
this.tabs = [
{ title: "Modules", content: "Modules.html", active: true},
{ title: "Modes", content: "Modes.html", disabled: true, active: false },
{ title: "Reports", content: "Reports.html", disabled: true, active: false }
];
this.modulesTab = this.tabs[0];
this.modesTab = this.tabs[1];
this.reportsTab = this.tabs[2];
this.modules = [];
this.modules.push({displayName:'PL',modes:[{title:'Mode 1',id:'Mode1'},{title:'Mode 2',id:'Mode2'}]})
this.selectMode = function(module, mode) {
var tab = this.modesTab;
tab.title = mode.title;
tab.active = true;
tab.disabled = false;
};
}
var emsApp = angular.module('EmsWeb', ['ui.bootstrap']);
emsApp.controller('LeftPaneCtrl', ['$scope',function($scope) {
$scope.leftPane = new LeftPaneModel();
}]);
Any ideas are appreciated.