I've searched and only can find things related to a random item, but what I want to do is get (for example) 7 random items from a larger group of items.
So right now I have code which gets me the first 7 items in my data, but I want to pull 6 random items instead.
<ul class="block-grid-4">
<li ng-repeat="icon in icons | limitTo:7"><i class="fa fa-fw fa-{{icon.id}}"></i> fa-{{icon.id}}</li>
</ul>
How can I simply get 7 (or any arbitrary number) items?
My service is
.factory('FaIconFactory', ['$http',
function($http) {
return {
getIcons: function() {
var icons = $http.get('scripts/data/fa_icons.js').then(function(response) {
return response.data.icons;
});
return icons;
}
};
}
]);