currently I am using ngx-codemirror - a angular wrapper on the codemirror.
in the my app
html as show
<ngx-codemirror [(ngModel)]="data" [autoFocus]=true [options]="{lineNumbers: true,theme: 'material',mode: 'markdown'}"></ngx-codemirror>
ts as show
data='';
json = {
"title": "Type",
"description": "A type of product",
"type": "object"
};
constructor(){
this.data = JSON.stringify(this.json);
}
it shows correctly the json text in a single line, but I want to show it in a json format instead of a string within a single line.
how would I do that?