AngularJS只有第一个元素在NG-重复动画 [英] AngularJS only first element in ng-repeat animates

查看:247
本文介绍了AngularJS只有第一个元素在NG-重复动画的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

有关使用下面的code某种原因,只ngRepeat动画中的第一项,并即时显示休息。只要 scope.categories 更新项目的NG-重复触发模板。

For some reason using the code below, ngRepeat only animates the first item and displays the rest instantly. As soon as the scope.categories item is updated the ng-repeat is triggered in the template.

dataSource.getCategories()
    .then(function(categories) {
        $scope.categories = categories;
    }, function(message) {
        dataSource.setActivity(false, message);
    });

但是,如果我改变code如下的添加<一个NG点击=开始()>开始< / A> 在页面中,它的工作原理。是的,我已经试过$超时,甚至可达5秒,并没有改变这种状况。

But if I change the code to the one below and add <a ng-click="start()">Start</a> in the page, it works. Yes, I have tried $timeout, even up to 5 seconds and it does not change the situation.

dataSource.getCategories()
    .then(function(categories) {
        $scope.start = function() {
            $scope.categories = categories;
        }

    }, function(message) {
        dataSource.setActivity(false, message);
    });

有没有人有一个解决的办法?

Does anyone have a solution to this?

推荐答案

我试着用AngularJS 1.2.9你的CSS,得到了相同的结果。它的工作原理与然而1.2.13。
已经有这么多的变化在1.2 ngAnimate模块* - 分枝所以没有更深的挖掘到这件事我的猜测是它是一个已经被修正了。

I tried your CSS with AngularJS 1.2.9 and got the same result. It works with 1.2.13 however. There have been so many changes to the ngAnimate module in the 1.2.*-branches so without digging deeper into the matter my guess is it's a bug that has since been fixed.

演示 - 1.2.9不工作 HTTP: //plnkr.co/edit/WvK2DDB6wTUkjx4Ah2bs?p=$p$pview

演示 - 1.2.13工作的http:/ /plnkr.co/edit/50UdTAKAsua85hyLc1O6?p=$p$pview

这篇关于AngularJS只有第一个元素在NG-重复动画的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆