date-time-picker: Error using with angular 5

ng-pick-datetime@5.2.6, angular@5.0.0

<input [owlDateTime]="dt1" [owlDateTimeTrigger]="dt1" placeholder="Date Time">
                                <owl-date-time #dt1></owl-date-time>

Following error occurs in Chrome console: Uncaught Error: Template parse errors: Can't bind to 'owlDateTime' since it isn't a known property of 'input'

Related issue #228

About this issue

  • Original URL
  • State: closed
  • Created 6 years ago
  • Comments: 16 (2 by maintainers)

Most upvoted comments

Hi @trinhcanhphuc ,

It works for me in Ionic3

Thank you very much giving reply.

Sorry for my bad English.

Hey @thurimerla , just make sure to import the OwlDateTimeModule and OwlNativeDateTimeModule in the correct Module that can reach your component. import { OwlDateTimeModule, OwlNativeDateTimeModule } from ‘ng-pick-datetime’;

Then just use it anywhere

<div>
                <mat-form-field fxFlex floatPlaceholder="never">
                  <input matInput [(ngModel)]="bestTimeToContact" placeholder="Select Date and Time" autocomplete="off"
                         [owlDateTimeTrigger]="dt" [owlDateTime]="dt">
                  <owl-date-time #dt></owl-date-time>
                </mat-form-field>

                <button mat-button (click)="chooseBestTimeToContact()">Done</button>
              </div>

            </div>

this is because you haven’t implemented the OwlDateTimeModule into your app.

This is not an issue from the picker and please use other platforms to ask general questions about Angular