Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- <form [formGroup]="myForm" (ngSubmit)="onSubmit()">
- <mat-form-field class="example-full-width">
- <input matInput placeholder="What is your name" [formControl]="myForm.controls['name']"/>
- <mat-error *ngIf="myForm.controls['name'].hasError('required')">Required!</mat-error>
- <mat-error *ngIf="myForm.controls['name'].hasError('maxlength')">Too long!</mat-error>
- </mat-form-field>
- <button mat-raised-button color="primary" type="submit" [disabled]="!form.isValid">Submit</button>
- </form>
Add Comment
Please, Sign In to add comment