我的简单角度2表格代码在下面
<form [formGroup]="myForm" (ngSubmit)="onSubmit()" class="formcss">
Username<br>
<input type="text" formControlName="username"><br><br>
<div>
Email<br>
<input id="email" type="text" formControlName="email">
<div *ngIf="myForm.find('email').valid">Invalid Email</div><br><br>
Password<br>
</div>
<input type="text" formControlName="password"><br><br>
<h3>Hobbies</h3>
<input type="text"><br><br>
<button>Add Hobby</button>
<button type="submit" [ngStyle]="{ background:'green'}" [disabled]="!myForm.valid">Submit</button>
</form>
我正在尝试显示消息&#34;无效的电子邮件&#34;是电子邮件提交不通过验证器,但收到此错误
error_handler.js:45 EXCEPTION: self.context.myForm.find is not a function
我正在使用角度2的最终版本。任何想法?