After completing the data update, I want the system to redirect the user to another page. I am using ui-router and was instructed to use $ state.go. But how do I use this command?
Follow my code:
app.controller("AtualizarUsuarioController", function ($scope, $window, $http, $state) {
$scope.usuario = {
'id': $window.localStorage.getItem('idUsuarios'),
'nome': $window.localStorage.getItem('nome'),
'email': $window.localStorage.getItem('email')
}
//$location.path('/atualizarUsuario' + $scope.usuario.id);
$scope.atualizarUsuario = function (usuario) {
$http.post("admin/php/atualizarUsuario.php", usuario).then(function (data){
$state.go("/usuario");
});
};
});