Here is a frequently asked question:
For reference, you can also check out this example on Plunker.
Details on animations can be found in the Developer Guide / Animations.
Understanding how animations work:
AngularJS animations rely entirely on CSS classes. By attaching a CSS class to an HTML element within your website, you can apply animations to it...
To implement animations for our ui-view
element, we can define CSS rules that correspond to the injected ngAnimation classes like .ng-enter
, .ng-leave
..
A snippet from the FAQ related Plunker:
[ui-view].ng-enter, [ui-view].ng-leave {
position: absolute;
left: 0;
right: 0;
...
transition:all .5s ease-in-out;
...
}
[ui-view].ng-enter-active {
opacity: 1;
...
transform:scale3d(1, 1, 1);
...
}
[ui-view].ng-leave {
opacity: 1;
...
transform:translate3d(0, 0, 0);
...
}