admin管理员组

文章数量:1341411

After selecting date time from owl date time picker event is not firing.

<label style='margin-right:5px ;margin-left:210px'>
							Date Time:
							<input [owlDateTimeTrigger]="dt" [owlDateTime]="dt"  class="form-control" placeholder="Date time Picker" (change)="getScheduledTime($event)">
							<owl-date-time #dt ></owl-date-time>
					</label>

After selecting date time from owl date time picker event is not firing.

<label style='margin-right:5px ;margin-left:210px'>
							Date Time:
							<input [owlDateTimeTrigger]="dt" [owlDateTime]="dt"  class="form-control" placeholder="Date time Picker" (change)="getScheduledTime($event)">
							<owl-date-time #dt ></owl-date-time>
					</label>

Share Improve this question asked Oct 9, 2018 at 11:23 kanchan belekanchan bele 531 gold badge2 silver badges9 bronze badges 2
  • I think ngModelChange will work – Asanka Commented Oct 9, 2018 at 11:51
  • I have added one working solution please check and let me know if any error. – Karnan Muthukumar Commented Oct 9, 2018 at 12:27
Add a ment  | 

2 Answers 2

Reset to default 10

Let Try this once, It's working fine tested, Html File,

<input placeholder="Date Time:"
               [(ngModel)]="dateTime"
               [owlDateTimeTrigger]="dt" [owlDateTime]="dt"
               (ngModelChange)="onChange($event)" <!--here added -->
               >

Typescript,

onChange(data) {
    alert("Triggered" + data);
    console.log("Triggered", data);
  }

Screenshot,

I hope its solve your problem.

Thanks,

Muthukumar

you can use ngModelChange for this

(ngModelChange)="getScheduledTime($event)"

本文标签: javascriptowldatetimeevent is not trigerring on date time selectStack Overflow