I have three dropdowns:-
<select clas="col-md-3" ng-model="a.userList" ng-change="selectValues(a.userList)">
<option>AX</option>
<option>AF</option>
<option>AM</option>
<option>BX</option>
<option>BF</option>
<option>BM</option>
<option>CX</option>
<option>CF</option>
<option>CM</option>
<option>DX</option>
<option>DF</option>
<option>DM</option>
</select>
<select clas="col-md-3" ng-model="a.userCode">
<option>A</option>
<option>B</option>
<option>C</option>
<option>D</option>
</select>
<select clas="col-md-3" ng-model="a.userId">
<option>X</option>
<option>F</option>
<option>M</option>
</select>
what I want is when user select AX then from other two dropdowns A and X got selected respectively and all the other values got removed from that two dropdowns.
My directive Code:-
scope.selectValues = function(userList){
switch(userList){
case "AX" : scope.a.userCode = "A";
scope.a.userId = "X";
break;
case "AF" : scope.a.userCode = "A";
scope.a.userId = "F";
break;
case "AM" : scope.a.userCode = "A";
scope.a.userId = "M";
break;
};
};
On the above code I am able to select the particular value which I want to select but not able to remove all the other values from the two dropdowns. Can anyone tell me how to remove the values from dropdowns.