Upload json on demand

1

I'm a beginner in angular and I'm doing a small application that consumes a json, but this json is very big and I wanted to load it on demand. I'm using the SPA concept and I use ngRoute as well, I just wanted to know how I can solve this, I'm already testing with some searches I've done. This is the application link: link

getCampanhas: function () {
  return $http.get('list.json');
},
    
asked by anonymous 31.08.2016 / 19:39

1 answer

0

Places a | limitTo: qtde in 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 you're loading, it's probably going to slow down because too much data, so paging would be a good option.

    
01.09.2016 / 14:49