Populate Dropdown 2 based on Dropdown 1 selection

You shouldn’t need 2 controllers for this, in fact that is probably one of the problems.
Once they are within the same scope you can easily tie them together. Use ng-change on the first option to trigger a function that gets the values to populate the second option.

Example Fiddle: http://jsfiddle.net/TheSharpieOne/Xku9z/

Also, you can use ng-show with the second select’s options array length to only show the second select when it has been populated.

Example Fiddle: http://jsfiddle.net/TheSharpieOne/Xku9z/1/

Leave a Comment