I'm facing an issue with parsing JSON data returned by Firebase. Here is the JSON snippet:
{
"-JxJZRHk8_azx0aG0WDk": {
"email": "<a href="/cdn-cgi/l/email-protection" class="__cf_email__" data-cfemail="cda6a68daaa0aca4a1e3aea2a0">[email protected]</a>",
"firstname": "dasd",
"lastname": "sadd",
"password": "dasdasd"
}
}
I am trying to access the email field from this JSON. Below is a snippet of my controller code:
var ref = new Firebase('url');
console.log($scope.user.email);
ref.orderByChild('email')
.startAt($scope.user.email)
//.orderBy('length')
//.startAt(10)
.on('value', function(snapshot) {
console.log(JSON.stringify(snapshot.val(), null, 2));
}
If anyone can provide assistance, I would greatly appreciate it.