Automatic dropdown box loading using angularjs

By | April 28, 2017

Populate a dropdown2 based on dropdown1

Here i am explaining the code for loading a state dropdown using country dropdown using angularjs and php.

Step1:create a database mytest_data and create 2 tables tbl_country and tbl_state. here country table is associated with
state table using country_id.

create the tables using the above code.

Step2:create two php files for loading state and country

loadcountry.php and loadstate.php as follows,

Step3: create a file called index.php it contains the angular1 code for doing the dropdownbox loading and display.