In a json object i filtered duplicate product and get array for creating dropdone for search.
$scope.value =[{"Product":"Table","Country":"United States","id":"17619"},{"Product":"Chair","Country":"Pakistan","id":"17618"},{"Product":"Keyboard","Country":"Pakistan","id":"17617"},{"Product":"Chair","Country":"Pakistan","id":"17615"}]
I filtered duplicate products and get array by this method
$scope.getProduct = function(){return ($scope.values || []).map(function(w){return w.Product;}).filter(function(w,idx,arr){return arr.indexOf(w)===idx;});};
it return Table, Char, Keyboard as array. which i used in dorpdonw by getProduct() function in this way
<select ng-model="product"><option ng-repeat="p in getProduct()" ng-model="filter[p]">{{p}}</option></select>
But i want output in sorted form like Char,Keyboard,Table. How can i sort array return by getProduct()
ng-model="filter[p]"inoption? you already have a model tagged to yourselectwithng-model="product".