Execute
<!DOCTYPE html> <html> <head> <title>Wikitechy AngularJS Tutorials</title> </head> <script src="https://ajax.googleapis.com/ajax/libs/ angularjs/1.4.8/angular.min.js"> </script> <body> <div ng-app="myApp" ng-controller="orderCtrl"> <h1>Wikitechy orderBy filter in AngularJS</h1> <ul> <h3>Technology list in ascending order</h3> <li ng-repeat="x in technology | orderBy : 'tut'"> {{x.tut}} </li> <h3>Technology list in descending order</h3> <li ng-repeat="x in technology | orderBy : '-tut' "> {{x.tut}} </li> </ul> </div> <script> var app = angular.module('myApp', []); app.controller('orderCtrl', function($scope) { $scope.technology = [ {"tut":"HTML"}, {"tut":"AngularJS"}, {"tut":"CSS"}, {"tut":"C"}, {"tut":"JAVA"}, {"tut":"PHP"}, ]; }); </script> </body> </html>
www.wikitechy.com © Copyright 2016. All Rights Reserved.