2016-02-28 44 views
0

我的代碼是:

<uib-tabset> 
    <uib-tab id="tab1" heading="Tab1"> 
    <div ng-include="'partials/tab1.html'"></div> 
    </uib-tab> 
    <uib-tab id="tab2" heading="Tab2" ng-controller="Tab2Controller"> 
    <div ng-include="'partials/tab2.html'"></div> 
    </uib-tab> 
    <uib-tab id="tab3" heading="Tab3" ng-controller="Tab3Controller"> 
    <div ng-include="'partials/tab3.html'"></div> 
    </uib-tab> 
</uib-tabset> 

它工作得很好,直到我更新AngularJS和AngularUI自舉,並得到:

Error: [$compile:multidir] 

爲每個標籤有自己的控制器(在我的情況下Tab2和Tab3)。

回答

0

的可能解決方案是將控制器設置到內DIV代替UI標籤元件:

<uib-tabset> 
    <uib-tab id="tab1" heading="Tab1"> 
    <div ng-include="'partials/tab1.html'"></div> 
    </uib-tab> 
    <uib-tab id="tab2" heading="Tab2"> 
    <div ng-include="'partials/tab2.html'" ng-controller="Tab2Controller"></div> 
    </uib-tab> 
    <uib-tab id="tab3" heading="Tab3"> 
    <div ng-include="'partials/tab3.html'" ng-controller="Tab3Controller"></div> 
    </uib-tab> 
</uib-tabset>