-
Notifications
You must be signed in to change notification settings - Fork 27.4k
Dynamic lookup of ng-animate value #2480
Comments
Here is a fiddle for ng-view where I am trying to do what I think @pennersr wants, but isn't working: |
I have been trying to do the same thing. See #2464. I wanted to animate the views in an application where the user can go back and forth between different steps. If the views always slide one way, it looks a little silly. |
👍 This is definitely something we need too. It would also be nice if the method passed in the |
Just checked @jmeiss 's link and apparently there's a way to make this work. |
@ncintra That helps but that's purely CSS to decide the direction based on a parent selector. Not even sure why you have a Taking @jeme example for this solution to work you would have to modify the DOM to set a new CSS parent. Where as everyone wants to be able to set the animation via a |
Hi @SparkiO , I see what you mean! Thanks for the clarification :) |
some solutions examples here : http://blog.revolunet.com/blog/2013/04/30/angularjs-animations-mobile-applications/ |
@revolunet Again that's the same as what @ncintra posted and isn't a viable solution to the problem @pennersr proposes followed by @jeme jsfiddle. Also, you should never touch the DOM from a Controller, it's a very specific Angular rule @mhevery discusses in many meetups/youtube events. Those solutions require CSS classes to decide the animation where as if you look at @jeme jsfiddle the problem is to support dynamic lookups of ng-animate value, not manipulate DOM. |
yes, i didnt get @ncintra jsfiddle was the one from my article :) the first example in the article just involves a |
+1 |
1 similar comment
+1 |
Updated the fiddle with an ng-include to show this is also broken. Also made some changes and fixed the fiddle so all the animations actually works (not entirely as you might wan't them to work, but at least you can see that fade fades, wave comes in from the side, view comes in from the side close to the center and fades, slide drops from the top) Also changed so that it is a Select box that is used to select... Starting with view: http://jsfiddle.net/nFhX8/66/ |
Looks like this was fixed in the latest 1.1.5 release! |
Confirmative -- here's an updated fiddle of the one @jeme made, but now using 1.1.5. It works! |
It doesn't work with latest Angular, where ng-animate is not present! |
@Pitel use ngClass instead. |
Hi, @matsko thanks for the update. I tried dynamic lookup using ng-class in 1.2.0-rc.2 but it doesn´t work. |
@doorman02 the ngClass toggling works, it was just your CSS code that wasn't following the new naming structure: |
@matsko Thanks it´s working now :) |
With angular-ui's ui-router,I was trying to modify the view animation dynamically, e.g. by using one of:
instead of the fixed:
While this works, the scope references are only evaluated once at link time, hence, changing those dynamically did not work.
So I submitted a pull request to lookup the ng-animate value dynamically. However, the maintainers are correctly stating that ui-view copied its ng-animate lookup behavior from the core Angular ng-view, and hence are hesitant to add support for this.
Could anyone please let me know what the official standpoint is on looking up the ng-animate value dynamically?
See angular-ui/ui-router#96 for the full discussion.
The text was updated successfully, but these errors were encountered: