I want to store token and user information in local storage ,things like store token and userId are okay except I can't include users detail information like email
this.login = function (data) {
var loginResults = Restangular.one('/users/login')
.post(undefined, data)
.then(function (data) {
var mytoken = data.id;
storeToken(data);
Restangular.setDefaultHeaders({ accept: 'application/json', access_token: mytoken });
},
function (Response) {
console.log("There was an error.");
});
return loginResults;
}
Finally I got the correct answer to include "user" here is the result....