mariohmol / ang-jsoneditor

Angular Jsoneditor that works with angular 4 to angular 15
https://stackblitz.com/edit/angular-json-editor
MIT License
155 stars 89 forks source link

Not able to track changes in the editor #139

Open gitsunny404 opened 6 months ago

gitsunny404 commented 6 months ago
 <json-editor
                  [options]="editorOptions"
                  [data]="schemaJsonData"
                  (change)="getDataFromJsonEditor($event)">
 </json-editor>

this is how i want to keep track on of the changes in the editor on change method

getDataFromJsonEditor(ev?: any) {
    console.log("full value##########", ev)
    if (ev && typeof ev === 'object' && !('isTrusted' in ev)) {
      console.warn("### data received for the change in the json editor ### :", ev);
      this.updatedSchemaJsonData = ev;
    }
  }

this is my method actually where I am using this for the page where I am getting the data and updating it.

The issue is when I do the changes for the first update the change event get tracked and emit successfully and when i submit the data and try to update the data once again the change event do not emit and get tracked.

What can be the issue. I have tried it for the normal input box and my methods are working fine. Can anybody help to keep track of the latest changes. I have tried the OnChange method from the editor option as well that is also not working.