Commit 2604553c68513510e36c408fa22a2a55f6016dcb
Exists in
master
Merge remote-tracking branch 'upstream/master'
Showing
3 changed files
Show diff stats
src/js/controller.js
| ... | ... | @@ -4,9 +4,10 @@ angular.module('focaBusquedaProductos') |
| 4 | 4 | '$filter', |
| 5 | 5 | '$scope', |
| 6 | 6 | '$uibModalInstance', |
| 7 | + 'idLista', | |
| 7 | 8 | 'focaBusquedaProductosService', |
| 8 | - function($filter, $scope, $uibModalInstance, focaBusquedaProductosService) { | |
| 9 | - focaBusquedaProductosService.getProductos().then( | |
| 9 | + function($filter, $scope, $uibModalInstance, idLista, focaBusquedaProductosService) { | |
| 10 | + focaBusquedaProductosService.getProductosByIdLista(idLista).then( | |
| 10 | 11 | function(res) { |
| 11 | 12 | $scope.productos = res.data; |
| 12 | 13 | $scope.search(); |
src/js/service.js
| 1 | 1 | angular.module('focaBusquedaProductos') |
| 2 | 2 | .service('focaBusquedaProductosService', [ |
| 3 | - '$http', | |
| 4 | - 'API_ENDPOINT', | |
| 3 | + '$http', | |
| 4 | + 'API_ENDPOINT', | |
| 5 | 5 | function($http, API_ENDPOINT) { |
| 6 | 6 | return { |
| 7 | 7 | getProductos: function() { |
| 8 | 8 | return $http.get(API_ENDPOINT.URL + '/articulos'); |
| 9 | + }, | |
| 10 | + getProductosByIdLista: function(id) { | |
| 11 | + return $http.get(API_ENDPOINT.URL + '/articulos/lista/' + id); | |
| 9 | 12 | } |
| 10 | 13 | }; |
| 11 | 14 | } |