editar consignatarios con history.back

This commit is contained in:
Javi Gallego 2017-01-23 15:20:00 +01:00
parent 27608619e6
commit c4d9cf1478
1 changed files with 3 additions and 2 deletions

View File

@ -5,7 +5,7 @@ export const NAME = 'vnClientAddressesDataEdit';
export const COMPONENT = { export const COMPONENT = {
template: template, template: template,
controllerAs: 'addressData', controllerAs: 'addressData',
controller: function($http, $stateParams, copyObject, equalsObject) { controller: function($http, $stateParams, copyObject, equalsObject, $window) {
this.address = {}; this.address = {};
$http.get(`/client/api/Addresses/${$stateParams.addressId}`).then( $http.get(`/client/api/Addresses/${$stateParams.addressId}`).then(
json => { json => {
@ -34,6 +34,7 @@ export const COMPONENT = {
} }
); );
} }
$window.history.back();
}; };
this.copyAddress = () => { this.copyAddress = () => {
@ -43,5 +44,5 @@ export const COMPONENT = {
} }
}; };
COMPONENT.controller.$inject = ['$http', '$stateParams', 'copyObject', 'equalsObject']; COMPONENT.controller.$inject = ['$http', '$stateParams', 'copyObject', 'equalsObject', '$window'];
module.component(NAME, COMPONENT); module.component(NAME, COMPONENT);