ng-repeat使用标签的问题

Roq*_*que 0 uiview angularjs angularjs-ng-repeat angular-ui-router angular-ui-tabset

我在使用选项卡内部的链接时遇到了问题,这些链接会更改视图并替换选项卡.仅在选项卡中使用ng-repeat但在静态选项卡中不使用时才会出现此问题.

那是主页:

<div  ui-view name="pageContent">
<uib-tabset>
    <uib-tab ng-repeat="tab in tabs" heading="{{tab.name}}"  active="tab.active" ng-click="!tab.disable && load(tab.link,tab.id)">
    </uib-tab>
    <!-- <uib-tab heading="Static title">Static content</uib-tab>
    <uib-tab heading="Static title">Static content 2</uib-tab> <!-- when I use the comment code it works. -->
    </uib-tabset>
    <div>
        <a class="btn btn-link" ui-sref="xxxx.yyyyy" role="button">
            {{$storage.aaaa.bbbbb}}
        </a><!-- this view replace the pageContent -->
    </div>
</div>
Run Code Online (Sandbox Code Playgroud)

错误是:

错误:[$ compile:ctreq]无法找到指令'uibTab'所需的控制器'uibTabset'!

提前致谢

Roq*_*que 5

我整理出来了.这就是代码.

 <div class="row top-margin" ng-show=" uiRouterState.current.name !='xxxx'">
   <div class="col-md-12">
      <uib-tabset>
         <uib-tab ng-repeat="tab in tabs" heading="{{tab.name}}"  active="tab.active" ng-click="!tab.disable && load(tab.link,tab.id)">
         </uib-tab>
     </uib-tabset>
  </div>
</div>
<div  ui-view name="pageContent">      
 <a class="btn btn-link" ui-sref="xxxx" role="button">
     Link 
 </a><!-- this link replace the "pageContent" with view xxxxx  -->
<div>
Run Code Online (Sandbox Code Playgroud)

我创建了一个名为$ scope.uiRouterState = $状态控制器中的$范围变量,存储当前的状态.