Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

ngRepeat with ngAnimate set "data-ng-animate= 2" on my element

I dont know why but ngRepeat add data-ng-animate=2 attr on my element. Why its happening?

I write this:

 <div class="aip-main-con-item animate-repeat"
      ng-repeat="event in events | 
      filter : searchEvent | 
      orderBy : 'date'">
 </div>

And I'm get this:

<div class="aip-main-con-item animate-repeat ng-scope"
     ng-repeat="event in events |
     filter : searchEvent |
     orderBy : 'date'" 
     data-ng-animate="2"
     style="">
</div>

Thank you!

like image 647
Zeev Katz Avatar asked Dec 18 '16 15:12

Zeev Katz


1 Answers

As you can see in the source code here the data-ng-animate attribute is used to track the state of the animation:

var PRE_DIGEST_STATE = 1;
var RUNNING_STATE = 2;

So basically it's just storing on the element itself the state of its own animation. In your case (2) that it's running. If you follow NG_ANIMATE_ATTR_NAME through that file you can follow it from getting added, updated, and finally removed from the element.

like image 50
Jack Avatar answered Oct 29 '22 19:10

Jack