I'm developing a system using angular js and php. The user enters his cpf and his password in a form, remembering that this user is registered in the database with his information, like, address, name, etc. When user enter his credentials, I get this data by angular js and refer to php using $http.post('php/login.php',user);
.
If the user's cpf is found in the database, I want it to return a JSON
with all user data and pass by parameter using ngRoute
with $location.path('pagina',+dados_usuarios)
:
$http.get('php/login.php', user).success(function(data) {
var result = JSON.stringify(data, null, 2);
console.log(result);
//$location.path('/dashboard/'+result);
}).error(function(data) {
console.log("Usuário não cadastrado!");
});
PHP is returning me json, but how can I use this json on another page in Angular JS?