Hello,

I have a FireBase location with a few items, and ref is a FB reference to 
that location. I want to retrieve an item using

ref.$child(name)

where 'name' is the key of an item in the FBlocation. If the item exists in 
the FB location, FB returns the item like this

email
"[email protected]"
lastLogin
"2014-02-25 22:01:26 +0100"
md5_hash
"2b764fcccac90624c7be4b5edf58f8b3"
registryDate
"2014-02-25 22:01:26 +0100"
username
"test user 1"
$add
function()
$auth
function()
$bind
function()
$child
function()
$getIndex
function()
$off
function()
$on
function()
$remove
function()
$save
function()
$set
function()
$transaction

If the item _doesn't_ exists in the FB location, FB returns the item like 
this

email
"[email protected]"
$add
function()
$auth
function()
$bind
function()
$child
function()
$getIndex
function()
$off
function()
$on
function()
$remove
function()
$save
function()
$set
function()
$transaction

So I figures, in order to know if the item exiosts in the FB location all I 
have to do is check for the existence of one of the keys lastLogin - 
lastLogin.

But doing this:

console.log(user.username)
console.log(user.username==undefined)

where user == the item that exists exists (so it is the first dump with te 
extra keys) returns 

undefined
true

How can I test if a ref.$child returned an existing item or a general 
object?

-- 
You received this message because you are subscribed to the Google Groups 
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.

Reply via email to