Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[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

Open
DiligentTuolaji opened this issue Nov 2, 2021 · 3 comments

Comments

@DiligentTuolaji
Copy link

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 #45 (comment)

@DiligentTuolaji DiligentTuolaji changed the title Sorry, I'm still having an issue with this on v1.10.5. I want to get null because i want to clear json and save [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 Nov 2, 2021
@mariohmol
Copy link
Owner

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

@PhilippS93
Copy link

@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

@mariohmol
Copy link
Owner

Could u please try the v4?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants