Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Animation is now evaluated dynamically #96

Closed
wants to merge 1 commit into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions src/viewDirective.js
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand All @@ -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)
Expand Down