Closed yukw777 closed 8 years ago
Yes you're right, it was done for more flexibility, in the example it is contained within a column width specification - hard to know where people want to place the tabs / target content.
This way is simpler though, happy to consider adding another HTML template like this into the repo.
Maybe it's sufficient to mention this in README.
Btw, the template needs to be fixed this way:
<div>
<uib-tabset class="tab-container" type="{{type}}" vertical="{{vertical}}" justified="{{justified}}">
<uib-tab class="tab" ng-repeat="tab in tabs" heading="{{tab.heading}}" active="tab.active" disable="tab.disable" ng-click="go(tab)">
<div ng-if="$first">
<ui-view></ui-view>
</div>
</uib-tab>
</uib-tabset>
</div>
Otherwise, it'll call the child state as many time as there are tabs because of ng-repeat.
Disregard, the template above does not work. I ended up fixing the problem via CSS.
Since ui-router-tabs expects ui-view to be defined outside of uib-tab, it behaves weirdly when you css expects your tab contents to be inside of uib-tab. I think the more natural default template is:
This way you don't need to specify ui-view explicitly, and everything is in its expected location.
Maybe this was intentional to give more flexibility? I'm currently using the template above for my application. Either way, let me know!