1

Please find my issue below.

I'm using Angular 5 formGroup and ngbDatepicker for date input. Date picker is working for new form, Please let me know how to bind the date to the date picker through formGroup & formControlName.

Version of Angular and Bootstrap: Angular: 5 Bootstrap: 4

Dinesh N.K
  • 71
  • 2
  • 10

1 Answers1

0

the only you need is that the input of ngbDatePicker was type of NgbDateStruct, that's is an Object with day,month and year properties

this.dataForm = this.fb.group({
     "fecha":[{year:2018,month:1,day:21}]
})
Eliseo
  • 50,109
  • 4
  • 29
  • 67