From e3a979164abb49920dd72701cc9fc4a16b2833ae Mon Sep 17 00:00:00 2001 From: Jose Pinto Date: Thu, 7 Feb 2019 16:19:40 -0300 Subject: [PATCH] redirects con location.path --- src/js/controller.js | 6 +++--- src/js/controllerCisterna.js | 8 +++++--- 2 files changed, 8 insertions(+), 6 deletions(-) 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); }); -- 1.9.1