Search code examples
angularjsonschemaangular-schema-formangular6-json-schema-formangular-json

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


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>


Solution

  • 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.