简体   繁体   中英

Value change for Ng Date Time Picker doesn't work

Nothing of events are not working for ng-pick-datetime

<label class="fieldlabel">{{ attribute.attribute.displayName }}: </label>
<label>
  <mat-form-field class="field-full-width">
    <input [owlDateTimeTrigger]="datePicker" placeholder="Date" [owlDateTime]="datePicker"
  [dateTimeInput]="emitValue()" [(ngModel)]="value.value">
    <owl-date-time #datePicker></owl-date-time>
 </mat-form-field>
</label>    

Also I import needed modules:

import { OwlDateTimeModule, OwlNativeDateTimeModule } from 'ng-pick-datetime';

https://www.npmjs.com/package/ng-pick-datetime 在此处输入图片说明

I have the same errors for other events: afterPickerOpen ,
yearSelected , monthSelected , dateTimeChange

dateTimeInput is an output (event) not an input. Hence, you need to use () instead of [] .

(dateTimeInput)="emitValue()"

For further information on outputs, read the official Angular docs .

The technical post webpages of this site follow the CC BY-SA 4.0 protocol. If you need to reprint, please indicate the site URL or the original address.Any question please contact:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM