I am working with MEAN.js application. I come accross one strange problem.
$scope.currentUser = Authentication.user;
console.log($scope.currentUser);
output:
{"_id":"5579c9a4f3d71f8c2a4f1e3d","email":"[email protected]","country":"US",
"gender":"Male","name":"Ilesh Patel"}
when I execute this than it prints all the data of currentUser but as soon as I do
$scope.currentUser = Authentication.user;
console.log($scope.currentUser.name);
then I get undefined. I don't know why I am not able to get name.