@@ -21,8 +21,9 @@ IonicModule.constant('$ionicNavBarConfig', {
21
21
* We can add buttons depending on the currently visible view using
22
22
* {@link ionic.directive:ionNavButtons}.
23
23
*
24
- * Assign an [animation class](/docs/components#animations) to the element to
25
- * enable animated changing of titles (recommended: 'nav-title-slide-ios7')
24
+ * Add an [animation class](/docs/components#animations) to the element via the
25
+ * `animation` attribute to enable animated changing of titles
26
+ * (recommended: 'nav-title-slide-ios7').
26
27
*
27
28
* Note that the ion-nav-bar element will only work correctly if your content has an
28
29
* ionView around it.
@@ -32,7 +33,7 @@ IonicModule.constant('$ionicNavBarConfig', {
32
33
* ```html
33
34
* <body ng-app="starter">
34
35
* <!-- The nav bar that will be updated as we navigate -->
35
- * <ion-nav-bar class="bar-positive nav-title-slide-ios7">
36
+ * <ion-nav-bar class="bar-positive" animation=" nav-title-slide-ios7">
36
37
* </ion-nav-bar>
37
38
*
38
39
* <!-- where the initial view template will be rendered -->
@@ -94,7 +95,7 @@ function($ionicViewService, $rootScope, $animate, $compile, $ionicNavBarConfig)
94
95
compile : function ( tElement , tAttrs ) {
95
96
//We cannot transclude here because it breaks element.data() inheritance on compile
96
97
tElement
97
- . addClass ( 'bar bar-header nav-bar ' + $ionicNavBarConfig . transition )
98
+ . addClass ( 'bar bar-header nav-bar' )
98
99
. append (
99
100
'<div class="buttons left-buttons"> ' +
100
101
'</div>' +
@@ -103,6 +104,12 @@ function($ionicViewService, $rootScope, $animate, $compile, $ionicNavBarConfig)
103
104
'</div>'
104
105
) ;
105
106
107
+ if ( isDefined ( tAttrs . animation ) ) {
108
+ tElement . addClass ( tAttrs . animation ) ;
109
+ } else {
110
+ tElement . addClass ( $ionicNavBarConfig . transition ) ;
111
+ }
112
+
106
113
return { pre : prelink } ;
107
114
function prelink ( $scope , $element , $attr , navBarCtrl ) {
108
115
navBarCtrl . _headerBarView = new ionic . views . HeaderBar ( {
0 commit comments