3

I used $index inside simple ng-repeat to show items' number:

 <li ng-repeat="item in dataList | limitTo:5">
      <span>{{ $index + 1 }} </span>
 </li>

And it worked OK for long time.

But sudden couple days ago I started getting:

Error: Error while interpolating: {{ $index + 1 }} illegal access
at Error (native)
at Object.k (/vendors/angular/angular.min.js:55:287)
at Object.e.$digest (/vendors/angular/angular.min.js:90:233)
at Object.e.$apply (/vendors/angular/angular.min.js:92:431)
at Object.<anonymous> (/js/controllers/HomePage.js:99:28)
at l (/vendors/jquery/jquery.min.js:4:24797)
at Object.c.fireWith [as resolveWith] (/vendors/jquery/jquery.min.js:4:25618)
at k (/vendors/jquery/jquery.min.js:6:5201)
at XMLHttpRequest.<anonymous> (/vendors/jquery/jquery.min.js:6:9005) 

at both production and local environments.

Data in dataList is correct and the same as was all time previous.

It is reproducible only in latest Chrome (32.0.1700.14) in other browsers it still working correct.

Any ideas why this can happen and how it can be fixed?

Angular version: 1.1.5.

4
  • 1
    What happened couple of days ago? :) Debugging with non-minified angular & jquery versions might help. Commented Nov 14, 2013 at 22:01
  • Couple days ago Google Chrome has been updated to 32.0.1700.14 :) Commented Nov 14, 2013 at 22:05
  • I cant reproduce, even with canary v33. Can you create a plunker with this code please? Commented Nov 14, 2013 at 22:21
  • 1
    Similar issue: code.google.com/p/chromium/issues/detail?id=318671 Commented Nov 14, 2013 at 22:45

2 Answers 2

1

Debugging showed that exception is thrown from angular.js:6371 on native adding operation, and it is not about AngularJS itself.

For those who are getting same issue, looks like the only solution is to find any alternative way of implementing your task on which it is failing. At least till next Google Chrome update.

Thanks to @Heikki for pointing to chromium issues tracker.

Sign up to request clarification or add additional context in comments.

Comments

1

Since the bug is related to String + Number concatenation I am using toString() on the numbers as a temp workaround.

{{($index + 1).toString()}}

worked in my case.

Comments

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.