Commit 92d128057e0cd124542e3b9dd35333e7ae1c036b
Exists in
master
and in
1 other branch
Merge branch 'master' into 'master'
Master See merge request modulos-npm/foca-modal-busqueda-productos!4
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 | } | 
