Granted, I just started with AngularFire and Firebase, but, it seems quite transparent, and well documented. Yet, there's one thing that doesn't make sense to me;
AngularFire has a $set function you can use to set values in the backend storage. From what I've read, in version 1.0.0 they deprecated this function, and it is now just "set" (without the $ sign). Difference seems to me that $set used to return a promise object, so one could chain functions, where as the new set function returns nothing it seems...
For instance, when I have this code:
function createprofile(authData, user){
return fbutil.ref('profiles/'+authData.uid).set({
firstname: user.firstname,
lastname: user.lastname
});
};
And my fbutil.ref function is as follows:
function firebaseRef(path) {
var ref = new $window.Firebase(FB_BASEURL);
var args = Array.prototype.slice.call(arguments);
if( args.length ) {
ref = ref.child(pathRef(args));
}
return ref;
}
How can I do something with the "createprofile"'s return value? At the moment, it's always "undefined". I was hoping I could just chain after a "set" function to make sure it actually worked before doing something else...