angular uib-tabset不激活选项卡

时间:2017-03-24 12:02:39

标签: angularjs angular-ui-bootstrap

  <div ng-show="isAppLoading" ng-cloak ng-controller="accListMainCtrl as vm" style="height:100%;">
    <h4>{{vm.dlg.active}}</h4>
    <uib-tabset>
      <uib-tab heading="Accounts list tree" ng-click="vm.load(1)" active="vm.dlg.active == 1"></uib-tab>
      <uib-tab heading="Accounts data grid" ng-click="vm.load(2)" active="vm.dlg.active == 2"></uib-tab>
    </uib-tabset>

    <ng-view></ng-view>
  </div>

我设置vm.dlg.active = 2,但第二个标签未激活。即使我设置了secont tab active =“true”,它也没有激活。

enter image description here

1 个答案:

答案 0 :(得分:1)

activeuib-tabset指令的属性,而不是uib-tab的属性,请参阅doc;试试

<uib-tabset active="vm.dlg.active">