Open matthewdolman opened 6 years ago
We encountered this same problem. The problem is that ngx-typeahead
expects the api to return an array – not an object (as shown in your snippet above).
To fix this, afaik, you need to transform the API response on your server so that it responds with an array rather than an object.
Feature Idea: It would be cool if ngx-typeahead
let us define a callback function where we could transform the raw API response (e.g. from an object into an array) before handing the data to ngx-typeahead
. This way, you could manage everything on the client.
Or... If not that, a more descriptive error message would probably be helpful.
Any chance you can give an example of what a "good" array would look like? Looking at the code and trying to guess is taking me nowhere fast.
I have been using the 'http' Api.
But when the response comes back from the server I get there error
ERROR TypeError: results.map is not a function
The structure of my returned object is