I'm new to Angular and am trying to make a tabs control that will load a state for each tab (dynamically).
My tabs code:
<uib-tabset>
<uib-tab index="$index + 1" ng-repeat="tab in tabData" heading="{{tab.heading}}" disable="tab.disabled">
<a ui-sref="{{tab.route}}">Click me</a>
</uib-tab>
</uib-tabset>
What I'm injecting in there:
$scope.tabData = [
{
heading: 'Companies',
route: 'LandingTemplate.Company',
disabled: false
},
{
heading: 'Users',
route: 'LandingTemplate.Users',
disabled: false
},
{
heading: 'Clients',
route: 'LandingTemplate.Clients',
disabled: true
}
];
Sample route:
.state('LandingTemplate.Company',
{
url: '/company',
views: {
'container@': {
templateUrl: 'App/Views/Admin.html'
},
'tabs-views@': {
templateUrl: 'App/Views/Company.html'
}
}
})
Currently how it's wired is you click a tab, click the link and that will render your view. I'd like to just click the tab. Any help would be appreciated.