【发布时间】:2016-11-21 15:41:32
【问题描述】:
我在 Angular 2 应用程序中使用 PrimeNG 自动完成功能,我试图在模糊事件上调用一个方法,但它没有调用该方法。下面是代码:
html:
<p-autoComplete [(ngModel)]="empText" inputStyleClass="form-control" [minLength]="1" [suggestions]="empData"
field="text" (completeMethod)="getEmployeeData($event)"
(blur)="onBlur($event.target.value)" (change)="onEmpDataChanged($event.target.value)"></p-autoComplete>
我的component.ts中有以下方法:
// Set touched on blur
onBlur(e: any) {
alert("control is blurred");
this.onTouchedCallback();
}
我尝试了更改事件,它工作正常,但自动完成的模糊不起作用。为什么不调用 onBlur 方法的任何建议。
【问题讨论】:
标签: angular typescript primeng