Animation not working with 1.4.x and ui-router: ng-hide-add and ng-hide-remove classes are not generated #12583
Description
My issue seems similar with #12267, I left a comment there but since that issue is closed, people might not read it.
@matsko worked on that issue.
ng-hide-add and ng-hide-remove classes are not generated. I am not using Material.
Debugging ngAnimate I noticed that all animations are skipped because:
- function 'areAnimationsAllowed' always returns false because:
- rootElementDetected is always false because:
- $rootElement var points to the element before the actual root element:
- rootElementDetected is always false because:
The element $rootElement points to is a comment and it is inserted by the ui-view directive which is present on the angular root element.
"ui-view" is a directive belonging to https://github.com/angular-ui/ui-router.
When ngAnimate is initialized $rootElement receives the correct value but probably when ui-router inserts its comment right before the angular root element, $rootElement is not updated. So when the animation happens, $rootElement points to instead of
Because 'areAnimationsAllowed' function does not find the angular root element, it retursn false and all animations are skipped.