Error 'orderBy' when updating to Angular 1.5.3 Error 'orderBy' when updating to Angular 1.5.3 angularjs angularjs

Error 'orderBy' when updating to Angular 1.5.3


This might be related to a breaking change in angular 1.5

Filters (orderBy)

Due to 2a85a634, passing a non-array-like value (other than undefined or null) through the orderBy filter will throw an error. Previously, the input was returned unchanged, which could lead to hard-to-spot bugs and was not consistent with other filters (e.g. filter). Objects considered array-like include: arrays, array subclasses, strings, NodeLists, jqLite/jQuery collections

Try using AngularJS toArray Filter

EDIT :

Because you sad you upgraded the app, I assumed it was working before. But to make it working I think you have to switch track by and order by statements

Note: track by must always be the last expression:

<tr ng-repeat="targeting in vm.TargetingsAudience | orderBy:orderByName track by $index  "><p ng-repeat="val in targeting.Values | orderBy:orderByName  track by $index  " class="targeting-value">{{val}}</p>


Change orderBy:orderByName to orderBy:'Name'