From 3f568b22f9bec09192588e3cae937db5c2e757f9 Mon Sep 17 00:00:00 2001 From: Matias Niemelä Date: Thu, 17 Oct 2013 14:29:06 -0400 Subject: fix(ngView): ensure the new view element is placed after the old view element Closes #4362 --- src/ngRoute/directive/ngView.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/ngRoute/directive/ngView.js') diff --git a/src/ngRoute/directive/ngView.js b/src/ngRoute/directive/ngView.js index ab1327d0..3a296b5b 100644 --- a/src/ngRoute/directive/ngView.js +++ b/src/ngRoute/directive/ngView.js @@ -207,10 +207,10 @@ function ngViewFactory( $route, $anchorScroll, $compile, $controller, if (template) { var newScope = scope.$new(); linker(newScope, function(clone) { - cleanupLastView(); - clone.html(template); - $animate.enter(clone, null, $element); + $animate.enter(clone, null, currentElement || $element); + + cleanupLastView(); var link = $compile(clone.contents()), current = $route.current; -- cgit v1.2.3