简体   繁体   English

Ng日期时间选择器的值更改不起作用

[英]Value change for Ng Date Time Picker doesn't work

Nothing of events are not working for ng-pick-datetime 在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 https://www.npmjs.com/package/ng-pick-datetime 在此处输入图片说明

I have the same errors for other events: afterPickerOpen , 对于其他事件,我也有相同的错误: afterPickerOpen
yearSelected , monthSelected , dateTimeChange yearSelectedmonthSelecteddateTimeChange

dateTimeInput is an output (event) not an input. dateTimeInput是输出(事件)而不是输入。 Hence, you need to use () instead of [] . 因此,您需要使用()而不是[]

(dateTimeInput)="emitValue()"

For further information on outputs, read the official Angular docs . 有关输出的更多信息,请阅读Angular官方文档

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

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