Romain Bouvet Romain Bouvet - 8 months ago 223
CSS Question

ng-enter-stagger animation is not working

I'm actually trying to animate a list of div created by ng-repeat.

I want them to appear one by one. So I saw I could use ng-enter-stagger but it's not working.

Here's my CSS :{
-webkit-transition:all linear 0.5s;
transition: all linear 0.5s ;


Here's the HTML :

<div ng-repeat="news in newsList" class="newsLeft" animate-on-load>
<div class="newsComponent" animate-on-load>
<div class="newsDate">{{}}</div>
<div class="newsSubT2">{{news.title}}</div>


The problem is the animate-on-load directive, so remove that.

Structural animations are by default disabled during the first one or two digest cycles after a view has been changed. You can override this by using ng-animate-children="true" on a parent element.

For example:

<body ng-animate-children="true">
  <div ng-view></div>


Note that this may trigger other animations in the view (for example for ng-show).

If you only want the animations for the ng-repeat you can use ng-if like this:

<div ng-repeat="news in newsList" class="newsLeft" ng-if="ready">

And in the controller:

$timeout(function () {

  $scope.ready = true;