question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

Model of Array does not get updated

See original GitHub issue

Hey 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. tst 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:open
  • Created 6 years ago
  • Comments:14 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
fbessoucommented, Jul 31, 2017

WidgetControl class implements the ngAfterViewInit hook. Does calling super.ngAfterViewInit in your hook solves the problem?

1reaction
ebrehaultcommented, Jun 9, 2017

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.

Read more comments on GitHub >

github_iconTop Results From Across the Web

Update of @Published array does no… - Apple Developer
Hi,. I have a view that displays pictures loaded via web service call. The model for the view is. @ObservedObject private var pictureController: ......
Read more >
java - Why elements in array of the objects are not updating?
You can see here, that I am trying to get some random button, from array of buttons i created in instance variable. Here...
Read more >
Indexed collections - JavaScript - MDN Web Docs - Mozilla
JavaScript does not have an explicit array data type. ... arrays can also be assigned as a property of a new or an...
Read more >
Working with scalar lists/arrays (Concepts) - Prisma
When using scalar list filters with a relational database connector, array fields with a NULL value are not considered by the following conditions:...
Read more >
Arrays - The Modern JavaScript Tutorial
The length property automatically updates when we modify the array. To be precise, it is actually not the count of values in the...
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found