相关疑难解决方法(0)

angular-ui tabs在tab-content中加载模板

我正在使用此控制器在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的语法.

angularjs angular-ui

11
推荐指数
1
解决办法
2万
查看次数

标签 统计

angular-ui ×1

angularjs ×1