Closed
Description
Overview
In the latest version (1.0.0-alpha.5), the schemaForm.merge
function reports incorrect keys for object properties stored in an array
Steps to Reproduce
- Open this Plunker demo
- Click the "Merge form and schema button" and look at the result
- In the result section, look at the keys reported for the child's name and age
Name
"key": [
"",
0,
"peopleLivingWithYou",
"dependentChildren",
0
],
Age
"key": [
"",
0,
"peopleLivingWithYou",
"dependentChildren",
0
],
Obviously these properties should not have the same key, and name
and age
should be last elements of the key
array.
If you remove the section
from the form, i.e. change the form definition to
$scope.form = [{
key: 'peopleLivingWithYou.dependentChildren',
add: "Add Child",
title: 'Dependent children details',
validationMessage: 'Complete all required fields for at least one child'
}];
The keys are correctly reported as
Name
"key": [
"peopleLivingWithYou",
"dependentChildren",
0,
"name"
],
Age
"key": [
"peopleLivingWithYou",
"dependentChildren",
0,
"age"
],
This problem does not exist in version 0.8.13.
@json-schema-form/angular-schema-form-lead