1

Upgrading AngularJS from version 1.4.9 to latest version 1.6.7 I'm facing a lot of errors in chrome console like:

angular.js:14794 Error: [orderBy:notarray] http://errors.angularjs.org/1.6.7/orderBy/notarray?p0=%7B%7D
    at angular.js:88
    at angular.js:22657
    at fn (eval at compile (angular.js:15645), <anonymous>:4:259)
    at angular.js:16752
    at m.$digest (angular.js:18351)
    at m.$apply (angular.js:18628)
    at angular.js:1958
    at Object.invoke (angular.js:5097)
    at c (angular.js:1956)
    at Uc (angular.js:1976)

Dealing with a large code base, it seems pretty much hard to pinpoint the places causing these errors. How can I trace the root cause of such problems? Are there any browser plugins available?

1 Answer 1

1

Use 'toArray:false' in your ng-repeat. This happens when filter or Orderby is applied in ng-repeat, but on Object instead of array.

 <div ng-repeat="i in obj | toArray:false | filter:searchText">
Sign up to request clarification or add additional context in comments.

1 Comment

1- Yet if I have 400 instances of orderBy, I can not figure out which one is fed an object, instead of an array. I mean I still can pinpoint the file and line number, because error trace is not precise. 2- toArray is a filter and should be added to code base: github.com/petebacondarwin/angular-toArrayFilter

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.