I am trying to get all the data from firebase. I logged in successfully by authenticated users and I also got the response from the firebase for retrieving other information.
When I try to read addInfo, address, categories, I get undefined but when I am try to read $id at that time I get it.
So, I am only able to get $id, I can not read other details.
$scope.loggedInUserData = addOffersService.getBusinessDetails(idd,"");
Now when I use:
console.log($scope.loggedInUserData)
then I get all the details.
But when I am trying to read
console.log($scope.loggedInUserData.addInfo);
console.log($scope.loggedInUserData.address);
I get undefined.
function getBusinessDetails(id,path) {
var query = db.child('/business/'+id+'/'+path);
return $firebaseObject(query);
}
What is wrong with the response?