I have been spending quite some time on this but I just can't seem to 
figure it out. Basically what I have right now is a custom directive called 
animateOnChange which watches for changes on a scope variable and performs 
an addClass and a subsequent removeClass animation using the $animate 
service on the element that it is being applied to. This works fine when 
the application initially starts since no data has been loaded yet, so once 
the data comes in the scope is updated, thus the variable changes and my 
animation is triggered.

However if I navigate to one of the other views of my application and 
return back to the first view the animation is not triggered. This kind of 
makes sense to me since the data is already there so the scope variable 
doesn't actually change. So I've now resorted to using the $timeout service 
to change the value on the scope 1 second after my controller has been 
initially constructed. This feels a bit hacky to me and I'm thinking there 
must be a better way to handle this, but I just can't seem to figure it 
out. Any ideas on how I might handle this better?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to