AngularJS provides animated transitions, with help from CSS.
An animation is when the transformation of an HTML element gives you an illusion of motion.
To make your applications ready for animations, you must include the AngularJS Animate library:
Then you must refer to the ngAnimate module in your application:
Or if your application has a name, add ngAnimate as a dependency in your application module:
ngAnimate
Do?The ngAnimate
module adds and removes classes.
ngAnimate
module does not animate your HTML elements by itself. Instead, when it detects certain events (like show/hide), it adds special class names to those elements which you can then use to create CSS-based animations.
ng-show
ng-hide
ng-class
ng-view
ng-include
ng-repeat
ng-if
ng-switch
The ng-show
and ng-hide
directives toggle the ng-hide
class.
The other directives use:
ng-enter
when elements enter the DOMng-leave
when elements are removed from the DOMThe ng-repeat
directive also adds ng-move
when elements are reordered.
For example, when using ng-hide
, Angular may apply the following classes:
ng-animate
ng-hide-animate
ng-hide-add
(if hiding the element)ng-hide-remove
(if showing the element)ng-hide-add-active
ng-hide-remove-active
You can use CSS Transitions or CSS Animations to animate these class changes.
To learn more:
CSS transitions allow you to change property values smoothly from one value to another over a set duration.
CSS Animations allows you to change CSS property values smoothly, from one value to another, over a given duration:
This project is developed as part of the AngularJS learning series by AIT – Academy of Information Technology.
It showcases the use of real-time task management with beautiful animations using AngularJS, ng-animate, and dynamic styling.
Students can use this daily for organizing their tasks while learning important frontend concepts.
A great beginner-to-intermediate level example combining HTML, CSS, AngularJS, animations, and logic handling for educational purposes.