【问题标题】:How to display firebase data in Angular template如何在 Angular 模板中显示 Firebase 数据
【发布时间】:2018-10-15 11:42:04
【问题描述】:

我在 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

【问题讨论】:

    标签: angular firebase firebase-realtime-database


    【解决方案1】:

    您可以使用prismjs 来美化输出。

    类似这样的:

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

    您可以了解更多here

    【讨论】:

    • 我可以使用另一种解决方案吗,即使从文档中我似乎也不明白它是如何工作的。谢谢
    猜你喜欢
    • 2019-01-14
    • 2018-08-29
    • 2018-06-29
    • 2019-04-02
    • 2016-05-06
    • 1970-01-01
    • 2018-08-19
    • 2019-09-19
    相关资源
    最近更新 更多