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

[Reactive form] Sorry, I'm still having an issue with this on v1.10.5. I want to get null from jsoneditor because i want to clear json and submit form value #94

Closed DiligentTuolaji closed 11 months ago

DiligentTuolaji commented 2 years ago

I'm still having an issue with this on v1.8.2 I'm using Angular 8.2.0

<form [formGroup]="newAnswerForm" (submit)="addAnswer()">
  ...
      <json-editor formControlName="answer" [options]="options"></json-editor>
  ...
</form>
this.newAnswerForm = this.fb.group({
      name: [''],
      answer: [{
        "answer": "This is a string."
      }],
      exactMatch: [true]
    });

"This is a string" populates the editor on load, but when I make changes within the JSON editor they are not saved when I go to submit the form. I also get an error in core.js:

ERROR TypeError: Cannot read property 'session' of null

Originally posted by @gentlemanjohn in https://github.com/mariohmol/ang-jsoneditor/issues/45#issuecomment-522175197

mariohmol commented 11 months ago

Hi, this is now under ang10, could u please double check?

PhilippS93 commented 6 months ago

@mariohmol , this issue seems to be still there in angular 17.

I am using version 3.1.1 and the form control is not updated when changing the JSON in the editor.

Best, Philipp