So I have this form, and it works fine.. but now I would like to extend the json structure some...
https://plnkr.co/edit/aYaYTBRHekHzyS0M7HDM?p=preview
The new structure I want to use looks like this (only address: has changed):
email: ['', [Validators.required, Validators.email]],
password: ['', [Validators.required, Validators.minLength(5)]],
address: this.fb.array([{
name: '',
addressLine1: ['', [Validators.required]],
city: ['', [Validators.required]],
postalCode: [Validators.required],
}]),
But I keep getting errors like "ERROR TypeError: control.registerOnChange is not a function". Figured out that this has to do with formControlName missing but I don´t want all data do show..
In the input field I only want addressLine1 to show (not showing name, city, or postalCode at all).
address
control are used ? thrown error because there is no formControl named address any more instead this is FormArray – CocoaFormArray
– Cocoa