Scroll + limitTo
by Andrew Byrne
HTML
<h2>What I have</h2>
<div class="test" ng-controller="Ctrl">
<div ng-repeat="division in divisions | orderBy:['-sub','group']">{{division.group}}-{{division.sub}}</div>
</div>
<h2>What I want</h2>
<div>1-4</div>
<div>3-3</div>
<div>6-2</div>
<div>4-1</div>
<div>2-</div>
<div>5-</div>
CSS
.test{
margin-bottom:20px;
}
JavaScript
var app = angular.module('app', []);
function Ctrl($scope) {
$scope.divisions = [{
'group': 1,
'sub': 4
}, {
'group': 2,
'sub': null
}, {
'group': 3,
'sub': 3
}, {
'group': 4,
'sub': 1
}, {
'group': 5,
'sub': null
}, {
'group': 6,
'sub': 2
}];
}