How can i bind date to date selector?
const TodayDate = "19-11-2020";
ngOnInit() {
this._MyregisterForm = this.formBuilder.group({
today_Date:[this.TodayDate, [Validators.required]]
});
}
HTML
<form [formGroup]="_MyregisterForm" (ngSubmit)="onSubmit()">
<input type="date" formControlName="today_Date" value="{{TodayDate}}">
</form>
No need to put
valueattribute in input when are usingformControlNameStackblitz Demo
component.html
component.ts