3

I have this simple tab panel:

<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>

and this simple controller:

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'}
];
});

my problem is that I would like for tab 1 to get its contents from an .html file, not from the static array. Is there a way to achieve this? If it can be of some use here's my plunker: http://plnkr.co/edit/mFkI7oDIeamqd444wlqr

2 Answers 2

6

ng-include is your friend

<div ng-include="tab.content"></div>

http://plnkr.co/edit/bAqoP9oY5apKAvvPQxOe?p=preview

Sign up to request clarification or add additional context in comments.

Comments

0

I have put ng-include="'managetab.html'" first , it shows

WARNING: Tried to Load Angular More Than Once

Then i put

<div ng-include="'app/views/managetab.html'"></div>

works fine ....

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.