From 5a1efd9be6c72caa69ba57c81ff07b4531d4fb0e Mon Sep 17 00:00:00 2001 From: Raymond Penners Date: Sat, 20 Apr 2013 20:21:01 +0200 Subject: [PATCH] Animation is now evaluated dynamically --- src/viewDirective.js | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/viewDirective.js b/src/viewDirective.js index 8bb089bb2..66a61bd32 100644 --- a/src/viewDirective.js +++ b/src/viewDirective.js @@ -10,8 +10,7 @@ function $ViewDirective( $state, $compile, $controller, $injector, $an link: function(scope, element, attr) { var viewScope, viewLocals, name = attr[directive.name] || attr.name || '', - onloadExp = attr.onload || '', - animate = $animator && $animator(scope, attr); + onloadExp = attr.onload || ''; // Find the details of the parent view directive (if any) and use it // to derive our own qualified view name, then hang our own details @@ -25,7 +24,8 @@ function $ViewDirective( $state, $compile, $controller, $injector, $an updateView(); function updateView() { - var locals = $state.$current && $state.$current.locals[name]; + var animate = $animator && $animator(scope, attr), + locals = $state.$current && $state.$current.locals[name]; if (locals === viewLocals) return; // nothing to do // Destroy previous view scope and remove content (if any)