最新消息:雨落星辰是一个专注网站SEO优化、网站SEO诊断、搜索引擎研究、网络营销推广、网站策划运营及站长类的自媒体原创博客

javascript - Adding nice transitions when updating a collection with AngularJS - Stack Overflow

programmeradmin2浏览0评论

I wonder how can I add some effects when updating a collection

<li ng-repeat="item in items | filter:filterFunction">
{{item.name}}
</li>

items is a collection, 30 for example.

This list only shows items that verify the filterFunction. The scope is regulary updated.

It works, but it's a bit violent!

Adding transitions with jquery could be great (fade in and fade out).

I wonder how can I add some effects when updating a collection

<li ng-repeat="item in items | filter:filterFunction">
{{item.name}}
</li>

items is a collection, 30 for example.

This list only shows items that verify the filterFunction. The scope is regulary updated.

It works, but it's a bit violent!

Adding transitions with jquery could be great (fade in and fade out).

Share Improve this question asked Oct 4, 2012 at 13:18 LaurentLaurent 9873 gold badges13 silver badges27 bronze badges
Add a comment  | 

4 Answers 4

Reset to default 12

I recommend you use the new ngAnimate directive provided in the AngularJS Core. It supports removal and is somewhat nicer to work with.

Read the documentation here. Read more about it on this awesome yearofmoo tutorial

Have a look at the animate directive in angular-ui

http://angular-ui.github.com/#directives-animate

It should help you achieve what you are trying to do. Just to let you know, the angular team has promised animations support for ng-repeat and ng-switch in the next or so major release. So keep your fingers crossed till then.

here's a decent article on the ngAnimate features and usage: http://www.yearofmoo.com/2013/04/animation-in-angularjs.html

A lot of a nice transtions at this site:

AnuglarJS Animations

发布评论

评论列表(0)

  1. 暂无评论