Hi there
We have Handsontable working fine in AngularJS applications, but when porting to Angular 5/6 with the wrapper, I’m facing issues with the Autocomplete cell
In AngularJs When declaring the search function, we use a service to look up data asynchronously, then resolve the data and pass back to the control. Quite straight forward
In Angular, I’m trying to do the same but declaring a function means local resources such as services are not visible within the function, or when declaring the function with the => syntax, resolving the data does not display the results.
Can you please let me know how async functions to return data for the autocomplete should be structured?
My example here doesn’t work
searchPerson = (query, process) => {
if(query.length > 3){
var results = [];
this.Api.searchPerson(query)
.then((res: Array<any>) => {
results = res.map(x => {
return x.userName;
});
process(results);
}
It might not be syntactically perfect as I’m typing from memory, but the gist is there.
The salient point is that the query is executed, but the process(results) does not return the data to the autocomplete control
Thanks!