Angular js is providing a very easy way to do client side sorting. Here I am going to explain about a simple client side sorting.
View
<select ng-model="sortorder1">
<option disabled value="">Choose one</option>
<option value="name">Name</option>
<option value="age">Age</option>
</select>
<ul>
<li ng-repeat="datalist in datalists | orderBy:sortorder1">
<div>Name : {{ datalist.name }} Age : {{ datalist.age }}</div>
</li>
</ul>
Here datalist is the json data ( $scope.datalists = data ;)
Related Posts
1. Angular ng-repeate in directive
3. Filtering concept in angular js
No comments :
Post a Comment