当前我正在使用ngx-codemirror
-代码镜像上的角度包装器。
在我的应用中
显示为HTML
<ngx-codemirror [(ngModel)]="data" [autoFocus]=true [options]="{lineNumbers: true,theme: 'material',mode: 'markdown'}"></ngx-codemirror>
显示为ts
data='';
json = {
"title": "Type",
"description": "A type of product",
"type": "object"
};
constructor(){
this.data = JSON.stringify(this.json);
}
它以一行显示正确的json文本,但我想以json格式显示,而不是一行中的字符串。
我将如何做?