How can I manually set an Angular form field as invalid?

Forums AngularHow can I manually set an Angular form field as invalid?
Staff asked 2 years ago

Answers (1)

Add Answer
prinkesha lathidadiya Marked As Accepted
Staff answered 1 year ago
<input mdInput placeholder="Email" type="email" name="email" required [(ngModel)]="email"  #email="ngModel">
<div *ngIf="!email.valid">{{email.errors| json}}</div>

Subscribe

Select Categories