How to load more elements with AngularJS?

后端 未结 3 1202
别那么骄傲
别那么骄傲 2021-02-06 17:07

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 th

3条回答
  •  醉酒成梦
    2021-02-06 17:18

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

    ..NG Repeat..

    Controller

    $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

提交回复
热议问题