Load json on demand

Asked

Viewed 136 times

2

I’m a beginner in angular and I’m making a small application that consumes a json, only this json is very large and I wanted to load it on demand. I’m using the concept of SPA and use tbm the ngRoute, I just wanted to know how I can solve this, I’m already testing with some searches I did. This is the application link: http://guruapp.com.br/gurudev/#/

getCampanhas: function () {
  return $http.get('list.json');
},
  • 1

    Your problem is with loading or viewing?

1 answer

0

Puts a | limitTo: qtde ng-repeat and creates a button to increment as the person clicks:

controller

$scope.qtde = 20;

$scope.carregarMais = function () {
  $scope.qtde += 20;  
};

$scope.dados = dados;

But as it loads, it will probably get slow because it is too much data, so paging would be a good option.

  • Hello Flavio, thanks for the reply. Really it still gets very slow, I will test with the pagination. Thanks for while.

Browser other questions tagged

You are not signed in. Login or sign up in order to post.