Created
August 4, 2018 05:40
-
-
Save pankajparkar/ec6efc18805220dc4ab984357d0ef1c3 to your computer and use it in GitHub Desktop.
Helper at the time of demo
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
<ng-template #form> | |
<form novalidate> | |
<label> | |
First Name | |
<input name="firstName" /> | |
<!-- <span>This field is required</span> --> | |
</label> | |
<label> | |
Last Name | |
<input name="lastName" /> | |
<!-- <span>This field is required</span> --> | |
</label> | |
<label> | |
Age | |
<input name="age" /> | |
<!-- <span>This field is required</span> --> | |
</label> | |
<label> | |
Hobbies | |
<input [(ngModel)]="newHobby" [ngModelOptions]="{standalone: true}" placeholder="Add new hobby ..." /> | |
<button type="button" (click)="addHobby()">+</button> | |
<hr /> | |
<ul *ngFor="let hobby of userForm.controls.hobbies.value"> | |
<li>{{hobby}}</li> | |
</ul> | |
</label> | |
</form> | |
</ng-template> | |
<ng-template #info> | |
<div>First Name: {{user.firstName}}</div> | |
<div>Last Name: {{user.lastName}}</div> | |
<div>Age: {{user.age}}</div> | |
<div> | |
Hobbies: | |
<ul *ngFor="let hobby of user.hobbies"> | |
<li>{{hobby}}</li> | |
</ul> | |
</div> | |
</ng-template> |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment