json-schema-form / angular-schema-form

Generate forms from a JSON schema, with AngularJS!
https://json-schema-form.github.io/angular-schema-form
MIT License
2.47k stars 653 forks source link

Change to field names in 1-alpha #896

Closed donalmurtagh closed 7 years ago

donalmurtagh commented 7 years ago

I'm not sure when exactly this changed, but prior to upgrading to the latest alpha, I was generating field names like this in my templates:

<input type="radio" name="{{form.key.join('.')}}">

The latest templates seem to recommend using the following instead

<input type="radio" name="{{::fieldId(true, false)}}">

I changed my templates to use the new field names and in the case of one particular field inside an array, this changes the field name from

name=".0.peopleLivingWithYou.dependentChildren.0"

to

name="current_form--0-peopleLivingWithYou-dependentChildren-0"

I think this should be mentioned in the migration guide, because there may be other parts of the application that rely on the old names.

More importantly, I discovered that the old names don't work for fields inside arrays

@json-schema-form/angular-schema-form-lead

Anthropic commented 7 years ago

Yes this was a fix for a bunch of name related issues both in arrays when fields had the same property names, radio issues and problems when the page had multiple form with fields named the same. I've tagged needs documentation, thanks :)

Anthropic commented 7 years ago

This can now be tracked in the migration doc issue