feat(ionTab): add class attribute to tab items

This commit is contained in:
Julien Goux
2014-05-14 14:46:48 +02:00
committed by Andrew Joslin
parent 6af5d68da4
commit e6f79cc0ff
3 changed files with 11 additions and 5 deletions

View File

@@ -64,6 +64,7 @@ function($rootScope, $animate, $ionicBind, $compile) {
attrStr('icon-off', attr.iconOff) +
attrStr('badge', attr.badge) +
attrStr('badge-style', attr.badgeStyle) +
attrStr('class', attr.class) +
'></ion-tab-nav>';
//Remove the contents of the element so we can compile them later, if tab is selected

View File

@@ -6,7 +6,7 @@ IonicModule
require: ['^ionTabs', '^ionTab'],
template:
'<a ng-class="{\'tab-item-active\': isTabActive(), \'has-badge\':badge}" ' +
' class="tab-item">' +
' class="tab-item {{class}}">' +
'<span class="badge {{badgeStyle}}" ng-if="badge">{{badge}}</span>' +
'<i class="icon {{getIconOn()}}" ng-if="getIconOn() && isTabActive()"></i>' +
'<i class="icon {{getIconOff()}}" ng-if="getIconOff() && !isTabActive()"></i>' +
@@ -18,7 +18,8 @@ IonicModule
iconOn: '@',
iconOff: '@',
badge: '=',
badgeStyle: '@'
badgeStyle: '@',
class: '@'
},
compile: function(element, attr, transclude) {
return function link($scope, $element, $attrs, ctrls) {