In this example we have a students array with the roll number, name, class and section of the student. By using ng-repeat directive we print the Name of the student and class of the student and orderBy
the ng-repeat by class. See the output the student of the 3rd class shows on the first position of the list then student of 4th class and so on. If you want to see the output in descending order then simply prefix minus sign to the 'cls' ( orderBy: '-cls' )
like this.