FaNaT
FaNaT

Reputation: 246

Ng-animate in new version of angular

My problem is that I have a code that works fine in angular 1.1.5 but in the newer version(1.4.3) it does not. It simply doesn't put the css classes xx-leave, xx-enter on the desired elements.

Example code in the comments(couldn't put it here)

It works jus fine in the older version but not with the new.

My question is what is that how could I make this work in the newer version of angular js?

Upvotes: 1

Views: 279

Answers (1)

Lucian
Lucian

Reputation: 644

Animations are not part of the core anymore. This means that you have to download and include the ngAnimate module into your app. (just like you do with ngResource for example).

The 'ng-animate' directive is now deprecated:

Instead, all animations are resolved from the CSS class(es) present on the element when an animation event is triggered and additional CSS classes are applied to the element to specify which animation is occurring. In other words, when a directive such as ngRepeat inserts an element into the DOM, it triggers an animation (the enter animation) and the $animate service appends the ng-enter and ng-enter-active CSS classes to the element.

These are just a couple of the changes introduced in version 1.2 of AngularJS regarding animations. You can read more in details here.

Upvotes: 2

Related Questions