0

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>

sjjk001
  • 175
  • 2
  • 12

1 Answers1

0

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.

sjjk001
  • 175
  • 2
  • 12
  • I have a JSON schem with three input select, but each one depend of above. So when i change for example **countries select** the input select of **cities of that country** should reaload and get back the info fom backend. But until today I have could not do it. If you have a example with code I thank you so much – SonickSeven Jan 13 '22 at 14:36
  • to bind your country data to the form use [data]="countryData" instead of [(model)]="countryData" and make sure that countryData is actually updating from the database when you change the country – sjjk001 Jan 13 '22 at 15:40