As of my understanding typeahead.js got three ways of fetching data.
- Local: hardcoded data
- Prefetch: Load a local json file, or by URL
- Remote: Send a query to the backend which responds with matching results
I want to fetch all data from the backend and then process it on the client. The data my server responds with got the following structure:
[{id:2, courseCode:IDA530, courseName:Software Testing, university:Lund University},
{id:1, courseCode:IDA321, courseName:Computer Security, university:Uppsala University}, ...]
I want it to search on all fields in each entry. (id, courseCode, courseName, university)
I wanna do more on the client and still fetching one time for each user (instead of every time a user are typing), I probably misunderstood something here but please correct me.