My knowledge in angular is little yet and I have doubts even a little dizzy, but come on hehe. I need a controller that shows recent records (8 latest) and another with a general list (20 items). See my reasoning below.
var app = angular.module('myApp', []);
app.controller('recentesCtrl', function($scope, $http) {
$scope.loading = true;
$scope.limitM = 8;
$http.get("http://www.folhacar.com.br/api/listAnuncios?revenda_id=528&cnpj=13733235000134")
.success(function (data) {$scope.nomes = data;}).finally(function() {
$scope.loading = false;
});
app.controller('listaCompletaCtrl', function($scope, $http) {
$scope.loading = true;
$scope.limitM = 20;
$http.get("http://www.folhacar.com.br/api/listAnuncios?revenda_id=528&cnpj=13733235000134")
.success(function (data2) {$scope.nomes2 = data2;}).finally(function() {
$scope.loading = false;
});
});
I'm not sure how I can do this effectively, since the 2 controllers are using the same API, same url, and everything.