What is the difference between $Animate and ngAnimate?

Asked

Viewed 75 times

3

At Angular 1, we have a service called $animate. This comes by default in Angular.

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

I’d like to know the difference between the two?

That one $animate dispenses with the use of ngAnimate?

References:

1 answer

4


These two providers are different ways to handle 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 present state differences.

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

Browser other questions tagged

You are not signed in. Login or sign up in order to post.