2016-11-16 78 views
0

我有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> 

回答

0

基本上你可以添加图标名称的另一个属性的阵列

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

内,该图标从NG-绑定重复。

+0

我可能会提到它是来自icomoon的图标。来自CSS。不确定是否有什么要说的?该图标基本上只是一个CSS类。 –

+0

试过你的解决方案,我无法让它工作。它只是将图标打印为字符串,平坦的html。 –

+0

基本上你必须在硬编码的地方使用它。 –