Created
September 20, 2017 11:52
-
-
Save matthieu-D/d8e013f9a3299a5cfd997c8a7b6f4ccf to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<form [formGroup]="userForm" connect="myForm" (ngSubmit)="onFormSubmitted()"> | |
<div> | |
<label> | |
<span>Name</span> | |
<input type="text" placeholder="Name" formControlName="name"> | |
<p *ngIf="userForm.controls.name.errors"> | |
This field is bad! | |
</p> | |
</label> | |
</div> | |
<div> | |
<label> | |
<span>Email</span> | |
<input type="email" placeholder="Email" formControlName="email"> | |
</label> | |
</div> | |
<div formGroupName="address"> | |
<div> | |
<label> | |
<span>Country</span> | |
<input type="text" placeholder="Country" formControlName="country"> | |
</label> | |
</div> | |
<div> | |
<label> | |
<span>City</span> | |
<input type="text" placeholder="City" formControlName="city"> | |
</label> | |
</div> | |
</div> | |
<input type="submit" [disabled]="userForm.invalid"> | |
</form> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment