简体   繁体   中英

Accessing controller inside overridden template-url of uib-tab

angular-bootstrap version used : 1.2.0
angular-version : 1.5.7

I am trying to override header html of uib-tab like below,

<li ng-class="{active: active, disabled: disabled}" class="uib-tab">
    <a ui-sref="MyController.overviewStateUrl" ng-click="select()" uib-tab-heading-transclude>{{heading}}</a>
</li>

When the page is rendered, the value for ui-sref is taken as MyController.overviewStateUrl instead of the real value which is stored in overviewStateUrl attribute of MyController . Is there any way to do it?

I tried to put it inside interpolation , but it returns empty string. Here's the plunker.

您是否尝试过以下代码?

<a ui-sref="{{MyController.overviewStateUrl}}" ng-click="select()" uib-tab-heading-transclude>{{heading}}</a>

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM