Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

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 enter image description here

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

like image 507
Maryna Avatar asked Jul 23 '18 16:07

Maryna


1 Answers

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.

like image 101
Kim Kern Avatar answered Nov 05 '22 10:11

Kim Kern