It looks like you could use a custom filter to resolve this, for example:
Custom Filter:
var app = angular.module('myApp', []);
app.filter('myFilter', function() {
return function(items, param1) {
var end= param1 == 1 ? Math.floor(items.length/2) : items.length ;
var start = param1 == 1 ? 0 : Math.floor(items.length/2) ;
console.log("param ",param1," start: ", start, " end: ", end);
return items.slice(start, end);
};
});
Html
<ul>
<li ng-repeat="item in items|myFilter:1">{{item.name}}</li>
</ul>
<div>second have</div>
<ul>
<li ng-repeat="item in items|myFilter:2">{{item.name}}</li>
</ul>
Where in your filter |myFilter:1
you set which half you want 1|2
.
Note: I thought about using a notation like '50%>' and '<50%' instead of 1|2 looking for a interesting way to make the filter more clear and extensible with possibilities to do things like 25%<, 75%> but I wasn't sure if it was necessary in your scenario. Hopefully 1|2 will do the trick.
Here is plunker demo