I have seen many examples of linking 2 SELECTs with one data source using AngularJS, but I was wondering if someone could point me to an example of linking 2 SELECTs that use 2 different data sources.
For instance, I have a SQLite database with a state table (with columns state_name and state_abbr). I have a cities table (with city_name, state_abbr, ...). I would like to have a SELECT in HTML that shows the states, but when I choose a state - it uses the state_abbr to populate a SELECT with cities. I have a factory that gets the states list and gets the cities list by state_abbr. Should I use one controller with 2 different methods or two controllers - one for each SELECT?
Any help would be greatly appreciated!
Frank
Aucun commentaire:
Enregistrer un commentaire