I am using Angular 8.
On my app.component.html I am displaying some json data linke this:
{{ myJsonData }}
This display is coming out like this:
{"information":"Information One","output":[{"ipaddress":"192.168.2.1","sName":"R45665"},{"ipaddress":"192.168.2.2","sName":"H4433D"}]}
But I need it to display like this:
{
"information":"Information One",
"output":[
{
"ipaddress":"192.168.2.1",
"sName":"R45665"
},
{
"ipaddress":"192.168.2.2",
"sName":"H4433D"
}
]
}
I've tried {{ myJsonData | json }}
But that just gives my lots of backslashes so makes the problem worse.
How can I do this?
JSON.parse(myJsonData)