Search Posts

How to set dropdown values to null using ng-change angular js?

  • I have one dropdown lets say Drop-down A, based on option selected from that, new dropdowns will be populated. For example,on selection of option 1 from Drop-down A, 2 new dropdowns will be showed. similarly on selection of other options new dropdowns will be populated and other dropdowns will be removed.
  • Now when I select options from newly populated dropdowns,I can get their value.
  • Problem comes when I select option 1 from Drop-down A and then select values from newly generated dropdowns, but now I wish to change Drop-down A slection to option 2. Now based on current selection, new dropdowns will be generated.
    So if now I post the values, my controller still shows, previous option 1 values.

    So how can I change unselected dropdown values to null?

    Plunker link : https://plnkr.co/edit/cNMVBG5ADIdY3MIPAXQj?p=preview

Source: AngularJS

Leave a Reply

Your email address will not be published. Required fields are marked *