[英]How to fetch data from json in Angular2 (TypeScript) without HTTP?
[英]how to make the editor text to get the data same as json data using angular2 or typescript
我有一个json数据,但是当它分配给编辑器时,它缺少引号,因此任何人都可以帮助我如何将引号也发送给编辑器。
ts代码:
this.product
.getproduct(t)
.subscribe(
products => {
let editorOptions = {
showJSONEditorTab: true
};
}),
}
这里我正在获取console.log(this.survey_val)输出,如下所示:
{"pages":[{"name":"page1"]}
console.log(this.editor.text);
{
pages: [
{
name: "page1",
]
}
我付出了努力,
let editorOptions = {
showJSONEditorTab: true, generateValidJSON : true
};
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.