我正在使用此控制器在angular-ui中使用选项卡:
$scope.panes = [
{ title:"Home", content:"home" , active: true},
{ title:"Settings", content:"settings"},
{ title:"View", content:"view"}
];
Run Code Online (Sandbox Code Playgroud)
这在html文件中:
<tabs>
<pane
active="pane.active"
heading="{{pane.title}}"
ng-repeat="pane in panes"
>
{{pane.content}}
</pane>
</tabs>
Run Code Online (Sandbox Code Playgroud)
但我想将内容设置为模板我该怎么做,我尝试在这个plunker中设置ng-include代码,但是没有用.
提前致谢.
如果您找到此解决方案并且您没有使用angular-bootstrap v0.12,则需要将代码更新为v0.13的新语法,如下所示:
<tabset>
<tab
active="pane.active"
heading="{{pane.title}}"
ng-repeat="pane in panes"
>
<div ng-include="pane.content"></div>
</tab>
</tabset>
Run Code Online (Sandbox Code Playgroud)
我已经更新了plunker以获得angular-bootstrap v0.13的语法.