<div ng-app="myapp" ng-controller="mycontroller as ctrl"> <div ng-repeat="n in ctrl.note | orderBy:'id' | limitTo:3" ng-bind="n.id"></div> <br /><br /> <div ng-repeat="n in ctrl.note | orderBy:'-id' | limitTo:-2" ng-bind="n.id"></div> </div>
angular.module("myapp",[]).controller("mycontroller",[function(){ var self = this; function getnote() { var note = [ { id: "1" }, { id: "2" }, { id: "3" }, { id: "4" } ] return note; } self.note = getnote(); }]);