所以我一直试图解决这个问题,我看到一个类似的帖子,但没有得到答复,所以我会尝试发布这个,但用一个 plunkr 作为示例。
所以问题是在加载时,我注意到 ui-tab 总是设置为 Add Tab 按钮。我想要做的是让 ui-tab ng-repeat 中的第一个元素处于活动状态,而不是静态的 Add Tab 按钮。
<uib-tabset active="activeTabIndex">
<uib-tab ng-repeat="tab in tabs" heading="{{tab.title}}">Some content</uib-tab>
<uib-tab heading="Add a tab" ng-click="addTab()" >Add a tab</uib-tab>
</uib-tabset>
https://plnkr.co/edit/XrYSKLdyN1cegfcdjmkz?p=preview
我怎样才能做到这一点?我已经研究了一段时间,但仍然不知道如何解决这个问题。
谢谢,