Select2 multiple dropdown not getting repopulated with the original values ​​after clearing the selected value?

when choosing a value via multi select in select2, the value is removed from the list and displayed in the selected value. but if I clear the value using

$("#mySel2").select2('data', null);

the value is cleared of the selected parameter, but not added back to the drop-down list / source list of values. Although it works fine if you select one value. Any sign or direction will be very helpful.

<select id="mySel2" multiple="multiple">
   <option ng-repeat="option in options" value="{{option.id}}">{{option.name}}</option>
</select>
+4
source share

All Articles