![](/img/trans.png)
[英]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.