angular-material-components icon indicating copy to clipboard operation
angular-material-components copied to clipboard

Can't bind to 'ngxMatDatetimePicker' @4.0.7

Open CreativeZoller opened this issue 4 years ago • 6 comments

Hi guys, Since the project is really legacy, I must use the 4.0.7 version of this. Sincerely I do not know what is the issue here... Using Angular 10.2.3. I included all Angular Material modules and FormModule, also ReactiveFormModule which is needed. I am using the input in this container:

<mat-form-field class="field" flex-gt-xs>
  <input matInput format="yyyy-MM-dd" [ngxMatDatetimePicker]="value" [min]="minDate" />
  <mat-datepicker-toggle matSuffix [for]="value"></mat-datepicker-toggle>
  <ngx-mat-datetime-picker #value [showSpinners]="false"></ngx-mat-datetime-picker>
</mat-form-field>

Unfortunately I get this error and have no idea how to solve since for me, everything seems fine:

error NG8002: Can't bind to 'ngxMatDatetimePicker' since it isn't a known property of 'input'.
<input matInput format="yyyy-MM-dd" [ngxMatDatetimePicker]="value" [min]="minDate" />

CreativeZoller avatar Aug 06 '21 14:08 CreativeZoller

have the same error with angular material 13.0.2

alegroSandermann avatar Dec 26 '21 15:12 alegroSandermann

Hi guys, Since the project is really legacy, I must use the 4.0.7 version of this. Sincerely I do not know what is the issue here... Using Angular 10.2.3. I included all Angular Material modules and FormModule, also ReactiveFormModule which is needed. I am using the input in this container:

<mat-form-field class="field" flex-gt-xs>
  <input matInput format="yyyy-MM-dd" [ngxMatDatetimePicker]="value" [min]="minDate" />
  <mat-datepicker-toggle matSuffix [for]="value"></mat-datepicker-toggle>
  <ngx-mat-datetime-picker #value [showSpinners]="false"></ngx-mat-datetime-picker>
</mat-form-field>

Unfortunately I get this error and have no idea how to solve since for me, everything seems fine:

error NG8002: Can't bind to 'ngxMatDatetimePicker' since it isn't a known property of 'input'.
<input matInput format="yyyy-MM-dd" [ngxMatDatetimePicker]="value" [min]="minDate" />

did you get a solution for this matter? Im facing the same issue,

image

oneal1801 avatar Jan 05 '22 15:01 oneal1801

Hi guys, Since the project is really legacy, I must use the 4.0.7 version of this. Sincerely I do not know what is the issue here... Using Angular 10.2.3. I included all Angular Material modules and FormModule, also ReactiveFormModule which is needed. I am using the input in this container:

<mat-form-field class="field" flex-gt-xs>
  <input matInput format="yyyy-MM-dd" [ngxMatDatetimePicker]="value" [min]="minDate" />
  <mat-datepicker-toggle matSuffix [for]="value"></mat-datepicker-toggle>
  <ngx-mat-datetime-picker #value [showSpinners]="false"></ngx-mat-datetime-picker>
</mat-form-field>

Unfortunately I get this error and have no idea how to solve since for me, everything seems fine:

error NG8002: Can't bind to 'ngxMatDatetimePicker' since it isn't a known property of 'input'.
<input matInput format="yyyy-MM-dd" [ngxMatDatetimePicker]="value" [min]="minDate" />

did you get a solution for this matter? Im facing the same issue,

image

Unfortunately not, no solving so far :/

CreativeZoller avatar Jan 06 '22 09:01 CreativeZoller

Hi,

I've realized that I had to put the import in my secondary model component as it was the main component for that screen. So I suggest you to check if your are using a king of infrastructure like this:

image

Do the import in the child module "secondary.module", not in the main one "app.module"

image

hope this works for you, regards.

oneal1801 avatar Jan 06 '22 12:01 oneal1801

Thanks, me working!.

git-rlagos avatar Jun 30 '22 06:06 git-rlagos

Thanks! It worked for me.

MateusBruscato avatar Sep 20 '22 23:09 MateusBruscato