Angularjs ng-repeat input blur after one keystroke

Viewed 780

If I try to do a ng-repeat to databind some fields to an array for example using the $index value then the input blurs automagically after 1 keystroke. Check the example to see what i mean.

(tested with angular stable 1.2.4 and latest: 1.2.5, and 1.1.1 from jsfiddle)

(fiddle: http://jsfiddle.net/Dj4n4/)

or the html bellow, same thing

<!doctype html>
<html ng-app>
  <head>
    <script src="js/angular.js"></script>
    <script type="text/javascript">
      function testController ($scope) {
        $scope.data = {
          a: 1,
          b: '2222',
          c: {
            d: 3,
            e: [1, 2, 3],
          }
        };
      }
    </script>
  </head>

  <body ng-controller="testController">
    Works: <label><input type="text" ng-model="data.c.e[1]" /></label>
    <br />
    Blurs after one keystroke:
    <label ng-repeat="no in data.c.e">
      <input type="text" ng-model="data.c.e[$index]" />
    </label>
    <pre>{{data | json}}</pre>
  </body>
</html>
2 Answers
Related