[英]PrimeNG autocomplete doesn't show suggestions
I'm using PrimeNg p-autocomplete in this way: 我以这种方式使用PrimeNg p-autocomplete:
<p-autoComplete id="area" [(ngModel)]="areaSearch" [ngModelOptions]="{standalone: true}" [suggestions]="results" (completeMethod)="retrieveArea($event)" field="name"></p-autoComplete>
In component: 在组件中:
retrieveArea(event) {
let searchString = event.query;
this.results = [];
searchString = searchString.toUpperCase();
this.service.retrieveAreaCa(searchString).subscribe(response => {
if (response.result) {
this.results = response.data.list;
//list = [{"name": "Paris", "code": "001"}, ...]
},
}
});
}
It worked fine with PrimeNG version 4.0.1 but, after updating to 4.2.0, it doesn't show suggestions on typing. 它在PrimeNG 4.0.1版本上可以正常工作,但是在更新到4.2.0之后,它没有显示输入建议。 I think there aren't differences to do in code after updating but I can't understand why it doesn't work.
我认为更新后代码没有区别,但是我不明白为什么它不起作用。 Any suggestions?
有什么建议么?
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.