Search
 
SCRIPT & CODE EXAMPLE
 
CODE EXAMPLE FOR JAVASCRIPT

when selecting second dropdown ng-model object return null

<select ng-options="option.name for option in $ctrl.getAvailableColumnOptions('secondColumnOption')" ng-model="$ctrl.secondColumnOption"></select>
<select ng-options="option.name for option in $ctrl.getAvailableColumnOptions('thirdColumnOption')" ng-model="$ctrl.thirdColumnOption"> </select>


getAvailableColumnOptions(ignoreOption) {
  return this.allAvailableColumnOptions
    .filter(x => (ignoreOption === 'secondColumnOption' || x.name !== this.secondColumnOption.name)
      && (ignoreOption === 'thirdColumnOption' || x.name !== this.thirdColumnOption.name)
      && (ignoreOption === 'fourthColumnOption' || x.name !== this.fourthColumnOption.name)
    );
}
 
PREVIOUS NEXT
Tagged: #selecting #dropdown #object #return #null
ADD COMMENT
Topic
Name
1+5 =