Does the limitTo filter in angular prevent loading other items in ng-repeat?

101 Views Asked by At

If I implement a 'load more' button that increases the limitTo filter in Angular.js, does the filter prevent loading the whole ng-repeat array?

What if I for example have 100 images in my ng-repeat. And i implement a limitTo filter with '9' on this. Is the user downloading the 100 images on page load or just the 9 images?

2

There are 2 best solutions below

0
Sampath On BEST ANSWER

Yes.It limits to 9 images.

Here it is from the Angular Doc:

limitTo

Creates a new array or string containing only a specified number of elements. The elements are taken from either the beginning or the end of the source array, string or number, as specified by the value and sign (positive or negative) of limit. If a number is used as input, it is converted to a string.

0
thaveethu gce On

Angular js will create a new array having 9 elements and iterate those 9