javascript - Cascading Dropdown List - Multi Direction -


first of quiet new angularjs , have seen several implementations of cascading dropdown lists yet not functioning way want and/or dont know how modify/extend them want.

maybe can point me right direction or post example. believe useful many people.

required functionality: multiple dropdown lists relational data in them. on selected item changed update other dropdowns based on selection.

example 1: 3 dropdowns. 1st 1 colleges, 2nd majors , 3rd degrees.

in examples when college selected majors in college displayed when major selected degrees shown. want when major selected filter colleges or when phd selected 3rd drop down remove colleges without phd programs or major without phd degree.

example 2: brand (bmw, audi, mercedes etc.), style (convertable, sedan, minivan etc.), price range(10k-20k, 20k-30k, 30k-50k etc.)

when brand chosen show styles , price ranges. when style chosen show brands have chosen style , remove price ranges have no item falling in range. when price chosen show brands , styles fall in range.

is link helpful ?

http://jsfiddle.net/annavester/zd6ux/

function ajaxctrl($scope) {     $scope.countries = ['usa', 'canada', 'mexico', 'france'];     $scope.$watch('country', function(newval) {         if (newval) $scope.cities = ['los angeles', 'san francisco'];     });     $scope.$watch('city', function(newval) {         if (newval) $scope.suburbs = ['soma', 'richmond', 'sunset'];     }); }  function staticctrl($scope) {     $scope.countries = {         'usa': {             'san francisco': ['soma', 'richmond', 'sunset'],             'los angeles': ['burbank', 'hollywood']         },         'canada': {             'people dont live here': ['igloo', 'cave']         }     }; } 

and there way using ng-change attr:

https://stackoverflow.com/a/14386972/3202657


Comments