HTML中的漂亮Json对象 [英] Pretty Json object in html

查看:118
本文介绍了HTML中的漂亮Json对象的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!

问题描述

如何在html中漂亮地打印JSON对象?我尝试了解决方案,但是没有用.请帮助我实现此目标所需做的事情.我尝试使用json管道:

How do I pretty print JSON object in html? I tried this solution but not working. Please help me what I need to do to achieve this. I tried using json pipe:

<div class="box box-default">                     
    <pre>{{placeDetail |json}}</pre>                  
</div>

推荐答案

尝试一下:

Try this:

    <div class="box box-default">
        <code>
            <pre>{{placeDetail |json}}</pre>
        </code>
    </div>

这篇关于HTML中的漂亮Json对象的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!

查看全文
登录 关闭
扫码关注1秒登录
发送“验证码”获取 | 15天全站免登陆