簡體   English   中英

如何使用angular2或typescript使編輯器文本獲取與json數據相同的數據

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM