【发布时间】:2020-06-04 08:09:02
【问题描述】:
目前我正在使用ngx-codemirror - 代码镜像上的角度包装器。
在我的应用中
html 显示
<ngx-codemirror [(ngModel)]="data" [autoFocus]=true [options]="{lineNumbers: true,theme: 'material',mode: 'markdown'}"></ngx-codemirror>
如实展示
data='';
json = {
"title": "Type",
"description": "A type of product",
"type": "object"
};
constructor(){
this.data = JSON.stringify(this.json);
}
它在一行中正确显示了 json 文本,但我想以 json 格式而不是单行中的字符串显示它。
我该怎么做?
【问题讨论】:
标签: angular codemirror