Hello,
Still looking fo the answer? I did it this way:
var FBItemsRef = new Firebase(AppConstants.FIREBASE_ISHARE_URL + 'items');
var FBContactsRef = new Firebase(AppConstants.FIREBASE_ISHARE_URL +
'contacts');
var itemsWithContactData = [];
FBItemsRef.once('value',function(snap){
snap.forEach(function(item){
//retrieve contact of item
FBContactsRef.child(item.val().contactId)
.on('value', function(contact){
// create ref to item.contact
var itemRef = item.child('contact').ref();
itemRef.set(contact.val());
itemsWithContactData.push(item.val());
});
});
});
this works and results in an array where each item.contact points to an
object containing the contact info. Firebase is a bit tricky though: I
wanted to short circuit
var itemRef = item.child('contact').ref();
itemRef.set(contact.val());
to
var itemRef = item.child('contact').ref()itemRef.set(contact.val());
but that results in an error that set() method is unknown....
Marc
--
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/d/optout.