Angular JSON Schema Form changing model data does not update the form

1.1k views Asked by At

I'm using Angular JSON Schema Form to build a form with a model which can change upon selection of a different option. The problem I get is that even thought the model variable changes in my component, the form does not reload its values.

This is my AJSF:

<json-schema-form #resinForm
    ngDefaultControl
    id="resinDisplayForm"
    loadExternalAssets="false"
    [schema]="mySchema"
    [(ngModel)]="myModel"
    framework="material-design"
    (onChanges)="onChangesResin($event)"
    (onSubmit)="saveSettings($event)"
    spellcheck="false"
></json-schema-form>

1

There are 1 answers

2
sjjk001 On BEST ANSWER

I've found the solution to my problem, basically I'm not using the [(model)] binding anymore I've changed to [data] and that works like a charm. Also, the two way binding [(data)] does not work.