0

Please or Register to create posts and topics.

Implementation of Datepicker on a Date field not binding to model

Hi,

This might be basic but I'm out of options on how to implement datepicker on a date field which is not binding to model. Need help on this one. Thank you.

Regards,

Fred

Hi,

it exists in the material.module.ts

import { MatDatepickerModule } from '@angular/material/datepicker';

for use:

<mat-form-field floatLabel="auto" fxFlex>
            <mat-label>{{'representative.DateOfJoining' | translate}}</mat-label>
            <input matInput readonly [matDatepicker]="picker1" [formControl]="dateOfJoining" [max]="maxDate" required >
            <mat-datepicker-toggle matSuffix [for]="picker1"></mat-datepicker-toggle>
            <mat-datepicker #picker1></mat-datepicker>
            <mat-error *ngIf="dateOfJoining.hasError('required')">{{'representative.errors.DateOfJoiningRequired' | translate}}</mat-error>
</mat-form-field>

 

Eben Monney has reacted to this post.
Eben Monney