Pha*_*ate 3 angularjs angular-ui-bootstrap
我有这个简单的选项卡面板:
<div ng-controller="TabsDemoCtrl">
<tabset>
<tab ng-repeat="tab in tabs" heading="{{tab.title}}" active="tab.active" disable="tab.disabled">
{{tab.content}}
</tab>
</tabset>
</div>
Run Code Online (Sandbox Code Playgroud)
而这个简单的控制器:
angular.module('ui.bootstrap.demo', ['ui.bootstrap']);
angular.module('ui.bootstrap.demo').controller('TabsDemoCtrl', function ($scope) {
$scope.tabs = [
{ title:'Dynamic Title 1', content:'/tab1.html' },
{ title:'Dynamic Title 2', content:'Dynamic content 2'}
];
});
Run Code Online (Sandbox Code Playgroud)
我的问题是我希望标签1从.html文件中获取其内容,而不是从静态数组中获取.有没有办法实现这个目标?如果它可以在某些用途这里是我的plunker:http://plnkr.co/edit/mFkI7oDIeamqd444wlqr
小智 6
ng-include是你的朋友
<div ng-include="tab.content"></div>
Run Code Online (Sandbox Code Playgroud)
http://plnkr.co/edit/bAqoP9oY5apKAvvPQxOe?p=preview
| 归档时间: |
|
| 查看次数: |
4927 次 |
| 最近记录: |