I am using the following code in my angular component template.
<input
type="text"
(click)="dp.toggle()"
ngbDatepicker
#dp="ngbDatepicker"
id="myDatePicker"
autocomplete="off"
placeholder="mm/dd/yyyy"
placement="bottom-left"
[maxDate]="maxDate"
formControlName="modifiedAfter" />
form group:
the form in component is:
searchForm = new FormGroup({
modifiedAfter: new FormControl(null),
name: new FormControl(null),
}) as TypedFormGroup<SearchModel>;
Removing the ngbDatePicker attribute to the input element doesnt throw the error.

im sure that you wrapped the input field in a form element and added
[formGroup]="searchForm "
right?
if so : is your input is in *ngFor ?
if not: check your module , see if you added NgbModule or NgbDatePickerModule? had a similar problem , maybe it helps