Hi,
I've been trying for weeks to get a proper chaining of db calls with
angularfire2 and displaying them. I always come back to the same solution
with the same errors.
ts code
this.user.subscribe(user => {
this._lists = this.db.list('/user/' + user.uid);
// this.lists = this.db.list('/starLists/');
this.lists = this.db.list('/user/' + user.uid, {query: {orderByKey:
true}})
.map((itemKeys) => {
return itemKeys.map(key => {
key.data = this.db.list(`'/starLists/${key.$key}`);
return key;
})
});
});
html
<ul>
<li *ngFor="let list of lists | async">
{{ list | json }}
</li>
</ul>
DB
{
"starLists" : {
"-KoJUYG0hZc3lt5AvQN-" : {
"name" : "Test",
"stars" : 0
},
"-KoRQF4wg0OFxaLtPW5v" : {
"name" : "list2",
"stars" : 0
}
},
"user" : {
"zKzdYljl5Lb0N0lqzz7hJZO6xB72" : {
"-KoJUYG0hZc3lt5AvQN-" : true,
"-KoRQF4wg0OFxaLtPW5v" : true
}
}
}
Error
ERROR TypeError: Converting circular structure to JSON
When logging it seems to turn out ok, but I'm pretty new to Obeservables,
does anyone have any input?
--
You received this message because you are subscribed to the Google Groups
"Angular and AngularJS discussion" 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 https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.