Update form group name to conform to Name interface

master
Kevin C. Coram 2019-09-07 21:33:49 -04:00
parent c17d79d16c
commit 2bf76e87c8
Signed by: kevin
GPG Key ID: 0342351B3D61AD35
3 changed files with 3 additions and 3 deletions

View File

@ -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">

View File

@ -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 />

View File

@ -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 : ''],