Hi
DatePicker not allowing to pick date. It is not appearing. It is also giving error - MatDatepicker can only be associated with a single input.
Code
Choose a date
MM/DD/YYYY
Choose a date
MM/DD/YYYY
Date of joining must be after date of birth.
-->
Cancel
SaveTypeScript
constructor(private _fb : FormBuilder){
this.form = this._fb.group({
dob: ['', Validators.required],
doj: ['', Validators.required]
})
}Thanks

Dwarkesh VajjalaRank #1,975 · 740 reputationPosted Jun 28, 2024, 2:41 AM EDT
app.component.html
import { Component } from '@angular/core'; import { FormBuilder, FormGroup, Validators } from '@angular/forms'; @Component({ selector: 'app-root', templateUrl: './app.component.html', styleUrls: ['./app.component.css'] }) export class AppComponent { form: FormGroup; constructor(private fb: FormBuilder) { this.form = this.fb.group({ dob: ['', Validators.required], doj: ['', Validators.required] }); } Save() { console.log(this.form.value); } }app.component.ts