here's my codes
return firebase.database().ref('groups/' + element).once('value').then(function(snapshot) {
if (snapshot.val() == null)
{
firebase.database().ref('groups/' + element + "/" + 0 + "/").set(elProfile.uid); //it fires here when snapshot.val() == null
}
else
{
firebase.database().ref('groups/' + element + "/" + 1 + "/").set(elProfile.uid); //it does not fire here when snapshot.val() != null
}
});
}, this);
my problem in the else case , it does not fire this code firebase.database().ref('groups/' + element + "/" + 1 + "/").set(elProfile.uid);
when snapshot.val() != null , why ??
via Ahmed Mohsen
No comments:
Post a Comment