Trying to write an Angular 2 pipe that will take a JSON object string and return it pretty-printed/formatted to display to the user.
For example, it would take this:
{
"id": 1,
"number": "K3483483344",
"state": "CA",
"active": true
}
And return something that looks like this when displayed in HTML:
So in my view I could have something like:
<td> {{ record.jsonData | prettyprint }} </td>
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…