service.js 588 Bytes
angular.module('focaAbmCliente')
    .factory('focaAbmClienteService', ['$http', 'API_ENDPOINT', function($http, API_ENDPOINT) {
        return {
            getAllClientes: function () {
                return $http.get(API_ENDPOINT.URL + '/cliente');
            },
            obtenerClientePorCodigo: function (cod) {
                return $http.get(API_ENDPOINT.URL + '/cliente-codigo/' + cod );
            },
            guardarCliente: function (cliente) {
                return $http.post(API_ENDPOINT.URL + '/cliente', { cliente: cliente });
            }
        };
    }]);