Reputation: 581
I'm using PrimeNg p-autocomplete in this way:
<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. I think there aren't differences to do in code after updating but I can't understand why it doesn't work. Any suggestions?
Upvotes: 1
Views: 3372
Reputation: 81
This component is not stable yet. There are some known issues about it. I had the same and after update to PrimeNG 4.3.0 everything works fine.
See these 1 and 2 from PrimeNG's Github
Upvotes: 1