如何在Angular模板中显示Firebase数据

时间:2018-10-15 11:42:04

标签: angular firebase firebase-realtime-database

我在Firebase中有此数据,我想使用Angular 4在html中显示,当我尝试向其中添加json({{order.items | json}})时,它显示整个结果,但未在表格中格式化类似的结构,易于阅读。谁能帮忙。

This the structure of the database, I want to get customer orders which includes items(product, quantity and totalPrice) and in product get the imageUrl,price and title

1 个答案:

答案 0 :(得分:0)

您可以使用prismjs来调整输出。

类似这样的东西:

<pre [innerHtml]="sortedObject | prettyjson:2" #prettyObjectElement></pre>

您可以了解更多here