Try posts.$getRecord(postId) inside your find function. Since the data is
already in the array and synchronized, there is no reason to create a
duplicate synchronized instance.
On Thu, Aug 7, 2014 at 4:08 AM, Dor Cohen wrote:
Hey, recently I noticed angularfire removed the method child().
I would like to know what is to correct way to handle child nodes:
var ref = new Firebase(FIREBASE_URL + 'posts');
var posts = $firebase(ref);
var Posts = {
create: function(foo) {
return posts.$push({some: foo});
},
find: function(postId) {
// no child method so I need another ref?
var postref = new Firebase(FIREBASE_URL + 'posts/' + postId)
return $firebase(postref);
}
}
also, if I want to add multiple number of child nodes
e.g posts/postId/comments/...
is the only way to do this with $set ?
Thanks alot,
Dor
--
You received this message because you are subscribed to the Google Groups
"Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/firebase-angular/e54f3ee8-90be-4c20-b5f5-c9c52a54e999%40googlegroups.com
<https://groups.google.com/d/msgid/firebase-angular/e54f3ee8-90be-4c20-b5f5-c9c52a54e999%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
--Hey, recently I noticed angularfire removed the method child().
I would like to know what is to correct way to handle child nodes:
var ref = new Firebase(FIREBASE_URL + 'posts');
var posts = $firebase(ref);
var Posts = {
create: function(foo) {
return posts.$push({some: foo});
},
find: function(postId) {
// no child method so I need another ref?
var postref = new Firebase(FIREBASE_URL + 'posts/' + postId)
return $firebase(postref);
}
}
also, if I want to add multiple number of child nodes
e.g posts/postId/comments/...
is the only way to do this with $set ?
Thanks alot,
Dor
--
You received this message because you are subscribed to the Google Groups
"Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an
email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit
https://groups.google.com/d/msgid/firebase-angular/e54f3ee8-90be-4c20-b5f5-c9c52a54e999%40googlegroups.com
<https://groups.google.com/d/msgid/firebase-angular/e54f3ee8-90be-4c20-b5f5-c9c52a54e999%40googlegroups.com?utm_medium=email&utm_source=footer>
.
For more options, visit https://groups.google.com/d/optout.
You received this message because you are subscribed to the Google Groups "Firebase + AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email to firebase-angular+unsubscribe@googlegroups.com.
To post to this group, send email to firebase-angular@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/firebase-angular/CAFHX4%3DriZ0FHMK4McNALs13CMKM89sHzxkcNR8GaUHH1DCk%3Dgg%40mail.gmail.com.
For more options, visit https://groups.google.com/d/optout.