Currently in my Angular 8 application, I have some data displaying in a div like so:
{"Information":"Information one","Output":[{"address1":"someaddress"},{"address2":"someaddress"},{"address3":"someaddress"},{"address4":"someaddress"}]}
However, it's all in a single line which is not optimal.
This is how the .html file appears:
<div><pre><code>{{ content }}</code></pre></div>
I attempted to format it using {{ content | json }}
, but the output looked like this:
"{\"Information\":\"Information one\",\"Output\":[{\"address1\":\"someaddress\"},{\"address2\":\"someaddress\"},{\"address3\":\"someaddress\"},{\"address4\":\"someaddress\"}]}"
Which made it even more difficult to read. So, what steps can I take to make it appear more structured like this:
{
"Information":"Information one",
"Output":[
{
"address1":"someaddress"
},
{
"address2":"someaddress"
},
{
"address3":"someaddress"
},
{
"address4":"someaddress"
}
]
}