mirror of
https://github.com/ionic-team/ionic-framework.git
synced 2026-03-13 10:22:08 +08:00
feat(navBar): allow expression in type. <nav-bar type="{{myType}}">
Closes #599
This commit is contained in:
@@ -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;
|
||||
|
||||
Reference in New Issue
Block a user