mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(ionTab): add class attribute to tab items
This commit is contained in:
committed by
Andrew Joslin
parent
6af5d68da4
commit
e6f79cc0ff
1
js/angular/directive/tab.js
vendored
1
js/angular/directive/tab.js
vendored
@@ -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
|
||||
|
||||
5
js/angular/directive/tabNav.js
vendored
5
js/angular/directive/tabNav.js
vendored
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user