In my app I have an API call that returns a JSON with the following (simplified) structure:
{
"prop1": "foo",
"prop2": "bar",
"details": "{\"title\": \"Sample Konfabulator Widget\", \"name\": \"main_window\", \"width\": 500, \"height\": 500}"
}
The details
prop contains a large stringified JSON that is read from the database.
Now, in the User Interface I want to display a prettified and formatted version of the details
prop, something like:
I've tried it with:
<pre>{{ apiResponse.details }}</pre>
But the entire JSON is displayed in a single line.
The code I've tried is: https://stackblitz.com/edit/angular-pkfgvf?file=src%2Fapp%2Fapp.component.ts
Thanks!