I have this method in my controllerJS script and would need to use the response of this method on another controllerJs.
How do I do it?
app.controller("loginController", function($scope, $http, $location){
$scope.usuarios = {};
$scope.autenticar = function() {
$http.post("/usuarioLogadoPermissoes", $scope.usuarios).then(
function(response) {
$scope.usuarios = response.data;
var jsonAux = JSON.stringify(response.data);
localStorage.setItem("usuarioLogado",jsonAux);
},
function(response) {
console.log(response);
});
};
});