我在火力地堡以下數據庫:多個對象火力地堡
Root Categories/ID/{text:Item1 AL:Item 2 TEXT:Item 3 ...}
我有下面的代碼來獲得我想要「的.text」或具有先前文本的一個項目:
this.categories = af.database.list('/categories/' + this.ID);
this.categories.subscribe(categories => console.log(categories));
this.categories.subscribe(
categories => {
categories.map(categories =>
console.log(categories.text),
)
});'
CONSOLE.LOG返回正是我想要的,但是當我在HTML檢索{{categories}}
文件,它返回Object
對象
有人知道如何解決它?對不起,我的無知我是一個初學者。
嘗試通過指定'類別= JSON.parse(類別)'和嘗試檢查的'categories'使用'typeof運算(類別)' –