-
Notifications
You must be signed in to change notification settings - Fork 27.5k
ng-animation: change animation based on variable #2464
Comments
There definitely needs to be a solution for changing the direction for direction based animations, such as animating moving left to right in an application or top to bottom. This seems like one possible solution that is pretty straight forward to use. |
I am new to Angular but I think I have a non-trivial example of how to workaround this missing feature. See my plunk. Let me know what you think. |
It worked well in 1.1.5 with |
All ng-class does, is add / remove the defined class. If you need more control, you'll have to revert to the javascript triggers for animations I think. I was just getting used to 1.1.5 animations, still need to get the hang of the new format.. |
@rkistner do you have a plunk that demonstrates this? I will be migrating to 1.2 very soon and would love to see what you have come up with so far. Also have you seen this http://www.yearofmoo.com/2013/08/remastered-animation-in-angularjs-1-2.html. |
@lockenj Thanks for that link - very useful. It has a section on this issue:
Unfortunately, it doesn't work so well for me. I've created a plunk here to shows my issue. When using |
Ok, my issue is a duplicate of #3727. Will check if dynamically changing it is possible after that fix. |
Ok, dynamically changing the animation seems to work (see plunk) when using the fixed version. I hope the fix makes it into the next release. |
Once this PR is in then the ngClass bugs are fixed: #3801 |
1.2rc2 has the fix. Please reopen if things are still broken. |
When using ng-animate with ng-view, I want to use a function to change the animation.
For example:
Page
Controller
If forward is true it animates one way, if it is false it animates a different way.
This approach doesn't seem to work. It appears that the animationSelect function is called only when the element is initially loaded. This is because the className is set at the start of the animateActionFactory function and then not updated on subsequent uses of the animation.
Further down a function is returned:
I am not sure if what I am trying to do is intended (or desired) functionality for angular's animation library. If it is, then moving the setting of the className into the function returned by animateActionFactory should solve the problem.
The text was updated successfully, but these errors were encountered: