Can the limitTo
filter be used on a ngRepeat
directive that is iterating over the properties of an Object instead of items in an Array?
Although it is stated in the official documentation that the limitTo
input should be an array or string, I am curious if there might be a way to make this work.
For reference, here is a snippet of the code:
<li ng-repeat="(key, item) in phones_dict |orderBy:'-age'| limitTo:limit_items"></li>
Where $scope.phones_dict
represents an Object structured like this:
{
item_1: {name:"John", age: 24},
item_2: {name:"Jack", age: 23}
}