feat(navBar): allow expression in type. <nav-bar type="{{myType}}">

Closes #599
This commit is contained in:
Andy Joslin
2014-02-13 14:55:50 -05:00
parent e106457e61
commit 5470d77ac0

View File

@@ -65,9 +65,10 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
backButtonType: '@',
backButtonLabel: '@',
backButtonIcon: '@',
alignTitle: '@'
alignTitle: '@',
barType: '@type'
},
template: '<header class="bar bar-header nav-bar invisible">' +
template: '<header class="bar bar-header nav-bar invisible {{barType}}">' +
'<div class="buttons"> ' +
'<button view-back class="back-button button hide" ng-if="enableBackButton"></button>' +
'<button ng-click="button.tap($event)" ng-repeat="button in leftButtons" class="button no-animation {{button.type}}" bind-html-unsafe="button.content"></button>' +
@@ -92,8 +93,6 @@ angular.module('ionic.ui.viewState', ['ionic.service.view', 'ionic.service.gestu
}
}
if(tAttrs.type) tElement.addClass(tAttrs.type);
return function link($scope, $element, $attr) {
var canHaveBackButton = !(!tAttrs.backButtonType && !tAttrs.backButtonLabel && !tAttrs.backButtonIcon);
$scope.enableBackButton = canHaveBackButton;