You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
We are going to build a custom type ahead angular directive that we can hook up to a factory for retrieving data to compare against.
This is useful anytime you want to interact with your databases and have auto completion based on that data.
We could use this to search against a users endpoint to auto complete a search for users.
For this example we are using an arbitrary set of data from a states.json file.
{
"name": "Alabama",
"abbreviation": "AL"
}
Since we are making a http request to a local file we need to run a server.
Use python -m SimpleHTTPServer 8000 within this directory to start a server that will serve our files.
When a user begins typing we want to filter all of the states by what they type. When they select a state we want to set the value in the text input to the selected state's abbreviation.