Take the 2-minute tour ×
Stack Overflow is a question and answer site for professional and enthusiast programmers. It's 100% free, no registration required.

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.

share|improve this question
1  
What happened couple of days ago? :) Debugging with non-minified angular & jquery versions might help. –  Heikki Nov 14 '13 at 22:01
 
Couple days ago Google Chrome has been updated to 32.0.1700.14 :) –  he-yaeh Nov 14 '13 at 22:05
 
I cant reproduce, even with canary v33. Can you create a plunker with this code please? –  Deividi Cavarzan Nov 14 '13 at 22:21
1  
Similar issue: code.google.com/p/chromium/issues/detail?id=318671 –  Heikki Nov 14 '13 at 22:45
add comment

2 Answers

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.

share|improve this answer
add comment

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.

share|improve this answer
add comment

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.