AngularJS ngRepeat tags are created if ngAnimate is loaded

Edit: I completely split the project into a minimum minimum and seems to be related to ngAnimate. The question is rewritten accordingly.

I had a problem with time over time, so in the end I have hundreds. This only happens on boot ngAnimate.

Versions:

"angular": "1.2.13",
"angular-animate": "~1.2.13"

JS:

'use strict';

var app = angular.module('app', ['ngAnimate']);

app.controller('TestCtrl', function($scope, $interval) {
  $scope.items = []

  $interval(function(){    
    $scope.items = [{
        "name": "Thing 1"
      },
      {
        "name": "Thing 2"
      }];
  },2000);
});

HTML:

<!DOCTYPE html>
<html>
  <head>
    <script src="vendor/angular/angular.js"></script>
    <script src="vendor/angular-animate/angular-animate.js"></script> 
    <script src="js/app.js"></script>       
  </head>
  <body ng-app="app">
    <ul ng-controller="MessagesCtrl">
      <li ng-repeat="item in items">
        {{item.name}}
      </li>
    </ul>
  </body>
</html>

When $intervalAngular fires, <!--end ngRepeat..,comment tags are displayed before closing </ul>:

<!-- end ngRepeat: item in items -->
<!-- end ngRepeat: item in items -->
<!-- end ngRepeat: item in items -->
<!-- end ngRepeat: item in items -->
<!-- end ngRepeat: item in items -->
<!-- end ngRepeat: item in items -->

(the number of comments increases unlimitedly over time)

Removing ngAnimatefrom the application fixes the problem.

+4
source share
1 answer
+1

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


All Articles