How to load more elements with AngularJS?

All we need is an easy explanation of the problem, so here it is.

for a while I am trying to find how to make a load more(elements from an array) button,using Angular.

I have 9 elements in array, I use ng-repeat to loop them, and limitTo:3 to output first 3.


1: is possible to make a load more button using only angular?(load more button is at bottom in example)

2: if not, how to make this work using jQuery?


How to solve :

I know you bored from this bug, So we are here to help you! Take a deep breath and look at the explanation of your problem. We have many solutions to this problem, But we recommend you to use the first method because it is tested & true method that will 100% work for you.

Method 1

You don’t need to think of jQuery, as you could solve this problem easily by using AngularJS itself.

You could maintain a variable inside your controller, name it as limit, then increment the limit variable inside loadMore() function.


<div ng-repeat="elem in | limitTo:travel.limit" class="cruises">

  ....COntent here...



app.controller('TravelController', function($scope) {
    var vm = this; = cruises;
    vm.limit = 3;

    $scope.loadMore = function() {
      var increamented = vm.limit + 3;
      vm.limit = incremented > ? : increamented;

Demo Plunkr

Method 2

You can combine @Pankaj Parkar response with infiniteScroll so you dont need even the button.

Method 3

No need of cracking any deep coding. Its simple to add just one line of code

<div ng-repeat="elem in | limitTo:travel.limit" class="cruises">

..NG Repeat..



$scope.loadMore = function() {
      vm.limit = vm.limit + 3;

Assigning variable to increase by the 3 or more number will make your code work easily.

Simple and easy trick

Note: Use and implement method 1 because this method fully tested our system.
Thank you 🙂

All methods was sourced from or, is licensed under cc by-sa 2.5, cc by-sa 3.0 and cc by-sa 4.0

Leave a Reply