3

According to several blogs, this should work.

<li ng-animate="{enter: 'animated shake'}" ng-repeat="name in names | filter:search">
  <a href="#"> {{name}} </a>
</li> 

Plunkr: http://plnkr.co/edit/Wlp0ckeEWHQcsrzIfAyk?p=preview

1 Answer 1

3

Since angular 1.2, ngAnimate works differently. See Matsko's article.

To get it working, you ony have to add specific class in your css. Example for ngIf directive :

.myItem.ng-enter {
  // animation
}

.myItem.ng-leave {
  // animation
}

Read the official docs here.

For using Animate.css with angular >= 1.2, you can read this article, example here.

.my-element.ng-enter {
  animation: fadeIn 1s;
}

.my-element.ng-leave {
  animation: fadeOut 1s;
}
Sign up to request clarification or add additional context in comments.

6 Comments

So we can no longer do animation without going into CSS and using AngularJS specific classes?
Right. The goal was to not use 'presentation based' directives in your html code. It's css job.
This one is only a css-class toggle based on ngClick. ngAnimate is used for animating automatically ngIf, ngShow, ngRepeat etc. directives.
So ng-animate is now deprecated. Seems like they've made it harder to integrate third-party animation libs, like animate.css. Not a good decision for non-CSS guys like me.
Nope! ngAnimate still works (and is much better), and you still can use Animate.css. Look at the bottom of my answer ! :)
|

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.