Open wautersj opened 6 years ago
I want to programatically clear the select and reset it in its original state. But am unable to do so.
I have tried to set the ngModel property to null, but this only works once. After resetting it a second time, the dropdown renders "undefined".
<iq-select2 #documentSearch css="form-control input-sm" [dataSourceProvider]="listDocuments" [iqSelect2ItemAdapter]="adapter" [selectedProvider]="" [placeholder]="placeholder" referenceMode="entity" (onSelect)="fileSelected($event)" (onRemove)="fileRemoved($event)" [(ngModel)]="selectedDocument" >
In code, I call this:
this.selectedDocument = null;
Help would be much appreciated!
I want to programatically clear the select and reset it in its original state. But am unable to do so.
I have tried to set the ngModel property to null, but this only works once. After resetting it a second time, the dropdown renders "undefined".
In code, I call this:
Help would be much appreciated!