angularfire2存储填充数据

时间:2018-02-01 10:29:44

标签: firebase ionic-framework firebase-realtime-database angularfire2

我有下一个数据库:食谱和配料

recipes: {
  "ingredients": {
    "id1": true,
    "id2": true,
    "id3": true
  }
}
ingredients: {
  "id1": {
    "text": "Ingrediente1",
    "quantity": "100g"
  },
  "id2": {
    "text": "Ingrediente2",
    "quantity": "200g"
  },
  "id3": {
    "text": "Ingrediente3",
    "quantity": "300g"
  }
}

当我访问食谱时,我必须"填充" de ID并返回正确的数据。 Somethig喜欢这样:

recipes: {
  "ingredients": {
    "id1": {
      "text": "Ingrediente1",
      "quantity": "100g"
    },
    "id2": {
      "text": "Ingrediente2",
      "quantity": "200g"
    },
    "id3": {
      "text": "Ingrediente3",
      "quantity": "300g"
    }
  }
}

有可能吗?我使用angularFire(^ 4.0.0-rc0),firebase(3.9.0)和离子3。

0 个答案:

没有答案