11
我使用的角度-UI的標籤:角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>
但我想要將內容設置爲模板,我該如何做到這一點,我嘗試在此plunker中設置ng-include代碼,但沒有奏效。
在此先感謝。
更新:
如果你發現這個解決方案,找你不使用的角度,引導v0.12您需要將代碼更新到the new syntax of v0.13這樣的:
<tabset>
<tab
active="pane.active"
heading="{{pane.title}}"
ng-repeat="pane in panes"
>
<div ng-include="pane.content"></div>
</tab>
</tabset>
我已經更新了plunker具有angular-bootstrap v0.13的語法。
謝謝,但你可以解釋爲什麼它的工作這種方式並不怎麼我第一次寫它,或者只是指出我在哪裏可以找到它。 – 2013-02-15 15:18:08
查看我的更新回答 – 2013-02-15 15:29:45
這很清楚,謝謝。 – 2013-02-15 15:36:24