diff --git a/src/js/controller.js b/src/js/controller.js index bc2b60d..e26f94a 100644 --- a/src/js/controller.js +++ b/src/js/controller.js @@ -175,12 +175,12 @@ angular.module('focaAbmVehiculo') delete $scope.vehiculo.cisternas; focaAbmVehiculoService.guardarVehiculo($scope.vehiculo) .then(function(res) { - if($scope.nuevo) { + if ($scope.nuevo) { $location.path('/vehiculo/' + res.data.id + '/' + res.data.idTransportista); - }else { + } else { guardarCisternas().then(function() { - $window.location.assign('/#!/vehiculo'); + $location.path('/vehiculo'); }); } }); diff --git a/src/js/controllerCisterna.js b/src/js/controllerCisterna.js index 8ab9fbb..72e5163 100644 --- a/src/js/controllerCisterna.js +++ b/src/js/controllerCisterna.js @@ -65,9 +65,11 @@ angular.module('focaAbmVehiculo') focaAbmVehiculoService .guardarCisterna($scope.cisterna, $routeParams.idx); - - $window.location.assign('/#!/vehiculo/' + $routeParams.idVehiculo + - '/' + $scope.transportista); + + $timeout(function() { + $location.path('/vehiculo/' + $routeParams.idVehiculo + + '/' + $scope.transportista); + }, 0); }, function(err) { focaModalService.alert(err); });