I have my result showing here
<div ng-repeat="o in vm.gridOptions.data | filter:filt | oderBy : 'title'">
<span>{{o.title}}</span>
</div>
which shows
<div ng-repeat="o in vm.gridOptions.data">
<span>aaa</span>
<span>ggg</span>
<span>ccc</span>
<span>bbb</span>
</div>
I have a select dropdown. I should able to sort my result alphabetally after i select 'Alphabetical
' option
<select ng-model="filt">
<option value="-1">vsf</option>
<option>Alphabetical</option>
<option>sccc</option>
</select>
Initially i have put orderBy:'title'. but this should happen after i select dropdown. how to achieve this ?
You can try this:
<div ng-repeat="o in vm.gridOptions.data | filter:filt | oderBy : filt?'title':''">