Created this simple test-case which shows the error occuring:
<tabset ng-repeat="tab in tabs">
<tab heading="{{tab.title}}">
<i ng-class="name_to_class[tab.title]"></i>{{tab.title}}
</tab>
<tab active="tab.active" disabled="tab.disabled">
<ul class="list-group">
<li class="list-group-item" ng-repeat="c in tab.content">{{ c }}</li>
</ul>
</tab>
</tabset>
var TabsDemoCtrl = function ($scope) {
$scope.name_to_class = {'Dynamic Title 1': 'pull-right', // icons in real-code
'Dynamic Title 2': 'pull-right'};
$scope.tabs = [
{ title:'Dynamic Title 1', content:['foo', 'bar'] },
{ title:'Dynamic Title 2', content:['can', 'haz'] }
];
};
You are not suppose to place ng-repeat
on tabset
( docs )
place ng-repeat
on tab
<tabset>
<tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disabled="tab.disabled" ng-class="name_to_class[tab.title]">
<ul class="list-group">
<li class="list-group-item" ng-repeat="c in tab.content">{{ c }}</li>
</ul>
</tab>
</tabset>
Try this. You need to repeat the tab not the tabset right?
<tabset >
<tab ng-repeat ="tab in tabs" heading='{{tab.title}}'>
<ul class = "list-group" >
<li class = "list-group-item" ng-repeat='c in tab.content'> {{c}}
</ul>
</tab>
</tabset>
The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.