I wanted to access a data in promise. I have the following code :
function getUser() {
Users.query({username: usersOnline}).$promise.then(function (results) {
console.log(results);
$scope.userss = results;
return results;
}, function(error) {
// console.log(error);
//$scope.meetups = [];
});
//$scope.userss[0].username='oui';
}
$scope.lol=getUser();
$scope.lol.then(function(user){
console.log(user.username);
});
But i get an error saying cant find property then of undefined can you help