init title classes w/ ng-enter and ng-leave

This commit is contained in:
Adam Bradley
2013-11-29 13:55:49 -06:00
parent 203304f374
commit 8a8d4eff18
2 changed files with 6 additions and 4 deletions

View File

@@ -1534,10 +1534,11 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
}
// Clone the old title and add a new one so we can show two animating in and out
// add ng-leave and ng-enter during creation to prevent flickering when they are swapped during animation
title = angular.element(titles[0]);
oTitle = $compile('<h1 class="title" ng-bind="oldTitle"></h1>')($scope);
oTitle = $compile('<h1 class="title ng-leave" ng-bind="oldTitle"></h1>')($scope);
title.replaceWith(oTitle);
nTitle = $compile('<h1 class="title" ng-bind="currentTitle"></h1>')($scope);
nTitle = $compile('<h1 class="title ng-enter" ng-bind="currentTitle"></h1>')($scope);
var insert = $element[0].firstElementChild || null;

View File

@@ -159,10 +159,11 @@ angular.module('ionic.ui.navRouter', ['ionic.service.gesture'])
}
// Clone the old title and add a new one so we can show two animating in and out
// add ng-leave and ng-enter during creation to prevent flickering when they are swapped during animation
title = angular.element(titles[0]);
oTitle = $compile('<h1 class="title" ng-bind="oldTitle"></h1>')($scope);
oTitle = $compile('<h1 class="title ng-leave" ng-bind="oldTitle"></h1>')($scope);
title.replaceWith(oTitle);
nTitle = $compile('<h1 class="title" ng-bind="currentTitle"></h1>')($scope);
nTitle = $compile('<h1 class="title ng-enter" ng-bind="currentTitle"></h1>')($scope);
var insert = $element[0].firstElementChild || null;