简体   繁体   English

将uib-tab标题绑定到范围属性

[英]Bind uib-tab heading to a scope property

I'm using uib-tabset 我正在使用uib-tabset

<uib-tabset class="tab-animation" id="tabSet">
                        <uib-tab ng-repeat="tab in tabs" heading="{{tab.title}}" ng-click="onTabClick($index)"
                                 active="tab.active"
                                 disable="tab.disabled">
                            <div ng-include="tab.content"></div>
                        </uib-tab>
</uib-tabset>

Controller : 控制器:

 /**
     * The buzz page tabs
     * @type {*[]}
     */
    $scope.tabs = [
        {title: 'Content', content: 'views/view.html'},
        {title: 'Tools', content: 'views/view2.html'},
        {title: 'Fans', content: 'views/view3.html'}
    ];

I want to add a number that can be changed after the initialize of the tubset. 我想添加一个在初始化管组后可以更改的数字。 The problem that i can't bind the tabset heading to a '$scope property or inseat it a ng-bind 我无法将Tabset标题绑定到'$ scope属性或将其设置为ng-bind的问题

For example Content(12) 例如内容(12)

Ok found the Solution. 确定找到了解决方案。

I just had to use uibTabHeadingTransclude directive of the UI.bootstrap. 我只需要使用UI.bootstrap的uibTabHeadingTransclude指令。

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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