My array is : BS
. Its structure is :
Array[317]
0: Object
$$hashKey: "022"
name: "Los Angeles Comm."
.
.
.
..
BS is an array. Each value is a JSon object with filed of name.
I want to sort all the values of BS according to their name. I am trying :
<option ng-repeat="item in BS | orderBy:item.name" value="{{item.name}}">{{item.name}}</option>
I have also tried : orderBy:name
and orderBy:item[name]
. Nothing works. Why is this not working and whats the correct code?