Angular using ngbdatepicker throwing RangerError: Maximum call stack size exceeded

252 Views Asked by At

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.

enter image description here

1

There are 1 best solutions below

1
Pouya Babaie On

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