HarveyChou
2 years ago
2 changed files with 44 additions and 22 deletions
@ -1,9 +1,15 @@ |
|||
<div [formGroup] = "form"> |
|||
<div formArrayName="Tasks" *ngFor="let control of tasks.controls; let index = index"> |
|||
<ng-container [formGroupName]="index"> |
|||
<input type="text" placeholder="主旨" formControlName="Subject"/> |
|||
<input type="text" placeholder="內容" formControlName="Content"/> |
|||
<div [formGroup]="form"> |
|||
<div> |
|||
帳號:<input type="text" formControlName="id" /> |
|||
<ng-container *ngIf="id.touched"> |
|||
<span *ngIf="id.hasError('required')">帳號為必填欄位</span> |
|||
</ng-container> |
|||
</div> |
|||
<div> |
|||
密碼:<input type="password" formControlName="password" /> |
|||
</div> |
|||
<div> |
|||
<button type="reset">重設</button> |
|||
<button type="submit">登入</button> |
|||
</div> |
|||
</div> |
|||
<pre>{{form.value| json}}</pre> |
Write
Preview
Loading…
Cancel
Save
Reference in new issue