在角度选项卡中的标题旁边插入不同的字体集图标

时间:2016-11-16 08:27:01

标签: angularjs tabs icons angular-ui

我有4个不同的标签,用角形标签制作。我想在选项卡中的每个标题文本旁边放置一个匹配的图标。关于如何做到这一点的任何想法?(新的角度)到目前为止,我只是静态地将相同的图标推出4次,而不是每个标签上的不同图标。我还没有从其他帖子找到任何解决方案。如果我监督了一个,请告诉我。

我的角度:

$scope.tabs = [
        { title: 'Mobilnumre', selected: function () { $scope.showAllSubscriptions(); } },
        { title: 'Medarbejdernumre', selected: function () { $scope.showEmployeeSubscriptions(); } },
        { title: 'Hovednumre', selected: function () { $scope.showPrimarySubscriptions(); } },
        { title: 'Mobilt Bredbånd', selected: function () { $scope.showDataSubscriptions(); } },
    ];

我的Html:

<uib-tabset active="active">
        <uib-tab index="$index + 1" ng-repeat="tab in tabs" heading="{{tab.title}}" select="tab.selected()">
            <tab-heading ng-repeat=""></tab-heading>
            <div ng-include="'MobileSubscriptionTable'"></div>
        </uib-tab>
    </uib-tabset>

1 个答案:

答案 0 :(得分:0)

基本上,您可以在数组中为图标名称添加另一个属性

$scope.tabs = [
        { title: 'Mobilnumre', selected: function () { $scope.showAllSubscriptions(); icon :'NameOfIcon'} },
    ];

并从ng-repeat中绑定该图标。