What is the difference between $ animate and ngAnimate?

3

In Angular 1, we have a Service named $animate . This already comes by default in the Angular.

But we also have a library, which is added optionally in the project, called ngAnimate . This is intended to add animations in ng-if , ng-repeat , ng-show and the like.

I would like to know what is the difference between the two?

Does this% with% exclude the use of $animate ?

References:

asked by anonymous 15.05.2017 / 21:20

1 answer

4

These two providers are different ways of dealing with the same module, module.animation() .

ngAnimate is a directive that is injected into directives (such as ngRepeat , ngView , ngIf , and others) that can benefit from the animation module to display state differences .

$animate is a service that allows you to programmatically handle the animation module, triggering events of classes ( $animate.addClass() , .removeClass() , .enter() , .leave() , and others ).

    
15.05.2017 / 21:44