我正在使用以下控制器使用 angular-ui 中的选项卡:
$scope.panes = [
{ title:"Home", content:"home" , active: true},
{ title:"Settings", content:"settings"},
{ title:"View", content:"view"}
];
以及 html 文件中的内容:
<tabs>
<pane
active="pane.active"
heading="{{pane.title}}"
ng-repeat="pane in panes"
>
{{pane.content}}
</pane>
</tabs>
但我想将内容设置为模板我该怎么做,我尝试在此设置 ng-include 代码plunker http://plnkr.co/edit/VUUPhgN602vHyMm1hEcT?p=preview,但没有用。
提前致谢。
update:
如果您找到此解决方案并且您没有使用 Angular-bootstrap v0.12,则需要将代码更新为v0.13的新语法 http://angular-ui.github.io/bootstrap/#/tabs像这样:
<tabset>
<tab
active="pane.active"
heading="{{pane.title}}"
ng-repeat="pane in panes"
>
<div ng-include="pane.content"></div>
</tab>
</tabset>
我已经更新了plunker http://plnkr.co/edit/VUUPhgN602vHyMm1hEcT?p=preview具有 angular-bootstrap v0.13 的语法。