I have JSON field like
{"facebook":"[email protected]",
"homeAddress":"26, New Street, Blr",
"officeAddress":"31, Old Office Street, Blr",
"city":"Blr",
name:"aravind"
},
{"facebook":"[email protected]",
"homeAddress":"26, New Street, che",
"officeAddress":"31, Old Office Street, che",
"city":"che",
name:"ashok"
}
In Angular js, I have ordered the field by name defaultly, I have one text box and button
<input type="text" class="form-control" ng-model="search.location" />
<div class="search" ng-click="locationSorting()"></div>
When i click the button after enter the location in text box( For Ex: blr). The list is sorted by location.
Currently i have finishing the filter by location. But i dont want filtering. I want sorting the list
var locationFilterHome = {homeAddress: location};
filterData = $filter('filter')(data, locationFilterOffice)
I am using above code for filtering. How to do sorting based on location
blras location , then output should be like first display all records which contain blr as city!! And then all records in ascending/descending order of city's name?? Or am i understanding wrong??