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

I don't know why, but ngRepeat adds data-ng-animate=2 attr to its element. Why is this happening?

I am writing this:

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

And I get the following:

 <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> 

Thanks!

+6
source share
1 answer

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

 var PRE_DIGEST_STATE = 1; var RUNNING_STATE = 2; 

Thus, basically it just stores the state of its own animation on the element itself. In your case ( 2 ), that it works. If you follow NG_ANIMATE_ATTR_NAME through this file, you can follow it after adding, updating, and finally removing from this element.

+3
source

Source: https://habr.com/ru/post/1013262/


All Articles