Update form group name to conform to Name interface
parent
c17d79d16c
commit
2bf76e87c8
|
@ -1,5 +1,5 @@
|
||||||
<form *ngIf="form" [formGroup]="form">
|
<form *ngIf="form" [formGroup]="form">
|
||||||
<ng-container formGroupName="nameGroup">
|
<ng-container formGroupName="name">
|
||||||
<div>
|
<div>
|
||||||
<label for="firstName">First Name: </label>
|
<label for="firstName">First Name: </label>
|
||||||
<input name="firstName" formControlName="firstName">
|
<input name="firstName" formControlName="firstName">
|
||||||
|
|
|
@ -1,5 +1,5 @@
|
||||||
<form [formGroup]="form">
|
<form [formGroup]="form">
|
||||||
<nested-forms-name [nameGroup]="form.get('nameGroup')"></nested-forms-name>
|
<nested-forms-name [nameGroup]="form.get('name')"></nested-forms-name>
|
||||||
<nested-forms-address-list [addressArray]="form.get('addresses')"></nested-forms-address-list>
|
<nested-forms-address-list [addressArray]="form.get('addresses')"></nested-forms-address-list>
|
||||||
</form>
|
</form>
|
||||||
<hr />
|
<hr />
|
||||||
|
|
|
@ -14,7 +14,7 @@ export class ContactFormService {
|
||||||
const addresses: FormArray = this.fb.array([]);
|
const addresses: FormArray = this.fb.array([]);
|
||||||
|
|
||||||
const group = this.fb.group({
|
const group = this.fb.group({
|
||||||
nameGroup: this.fb.group({
|
name: this.fb.group({
|
||||||
firstName: [name ? name.firstName : ''],
|
firstName: [name ? name.firstName : ''],
|
||||||
lastName: [name ? name.lastName : ''],
|
lastName: [name ? name.lastName : ''],
|
||||||
middleName: [name ? name.middleName : ''],
|
middleName: [name ? name.middleName : ''],
|
||||||
|
|
Loading…
Reference in New Issue