Angular 2 pipe that transforms JSON object to pretty-printed JSON

I would like to add an even simpler way to do this, using the built-in json pipe:

<pre>{{data | json}}</pre>

This way, the formatting is preserved.

Leave a Comment