Model of Array does not get updated
See original GitHub issueHey guys,
sorry for again opening a issue. I love your library. Great job! My Problem: I have this snippet as part of my schema file:
region: { title: "Deployment Region(s)", type: "array", items: { type: "string", title: "items", description: "items", oneOf: [{ description: "EU", enum: [ "EU" ] }, { description: "US", enum: [ "US" ] }, { description: "RUS", enum: [ "RUS" ] }, { description: "CANADA", enum: [ "CANADA" ] }, { description: "SOUTH-AMERICA", enum: [ "SOUTH-AMERICA" ] }, { description: "ASIA-PACIFIC", enum: [ "ASIA-PACIFIC" ] }, { description: "OTHER", enum: [ "OTHER" ] } ], widget: "select" }, minItems: 1, uniqueItems: true, description: "Deployment Region(s)" }
It is an array to which the user can add selects and the rendering works perfectly.
My problem now: I want to generate a json by using the model. But the values do not update the values of the array elements. The model contains the added items but the values are still empty. All other values on a higher level are all set correctly.
"region": [ "", "" ]
Hope you can help 😃
Issue Analytics
- State:
- Created 6 years ago
- Comments:14 (4 by maintainers)
Top GitHub Comments
WidgetControl class implements the ngAfterViewInit hook. Does calling super.ngAfterViewInit in your hook solves the problem?
I have added your Region field in the test app here: https://github.com/makinacorpus/angular2-schema-form/blob/master/tests/src/app/sampleschema.json
and it seems to work properly, I get this kind of output:
"region":["US","SOUTH-AMERICA"],
So I guess your problem comes from something else in your app. I suggest you make a new empty app, use your schema and then progressively move over your original app elements to see when it fails.