AngularJS ngRepeat and orderBy.

by Sajeetharan Sinnathurai

HTML

<div ng-app="myApp" ng-controller="Ctrl">
    <div ng-repeat="card in myCards | orderBy:'-type'">
        <businesscard>{{card.name}} {{card.type}}</businesscard>
    </div>
</div>

JavaScript

angular.module('myApp', [])
    .controller('Ctrl', function($scope) {
        $scope.myCards = [
           {
    name: "Item 1",
    type: "Start Time"
  },
  {
    name: "Item 2",
    type: "End Time"
  }
        ];
    });