簡體   English   中英

Ng日期時間選擇器的值更改不起作用

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

在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>    

我也導入所需的模塊:

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

https://www.npmjs.com/package/ng-pick-datetime 在此處輸入圖片說明

對於其他事件,我也有相同的錯誤: afterPickerOpen
yearSelectedmonthSelecteddateTimeChange

dateTimeInput是輸出(事件)而不是輸入。 因此,您需要使用()而不是[]

(dateTimeInput)="emitValue()"

有關輸出的更多信息,請閱讀Angular官方文檔

暫無
暫無

聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM