Joining AngularFire paths on a value/key is not working (merging user profiles into records)

前端 未结 3 1250
长发绾君心
长发绾君心 2021-01-25 02:10

I am developing an application with Firebase (1.0) and Angular (1.4). The problem I\'m having is to ensure the data in view are synchronised with Firebase, while fetching denorm

3条回答
  •  北荒
    北荒 (楼主)
    2021-01-25 03:03

    What I see is that your json data for books has author as an object. This is what is passed into the $getRecord method.The ID of the author is a key, not a value.

    I believe if you structure your data like this:

    books: { -JyDpkQrUozE3L7flpo: { title: "title1", author: "-JyDpkQrUozE3L7fl1x" } -JyDpkQrUozE3L7flp1: { title: "title2", author: "-JyDptrrrezE3L7flKx" }, -JyDpkQrUozE3L7flp2: { title: "title3", author: "-JyDpkQrUozE3L7f222" }

    It should work, but it has been a long time since I have used firebase.

提交回复
热议问题