Topic: Reset Selectbox
<mdb-select[options]="eventDropDown"placeholder="Events"[(ngModel)]="searchEventId"name="eventId"></mdb-select>
Arkadiusz Idzikowski
staff answered 7 years ago
pparesh
pro premium priority answered 5 years ago
Arkadiusz Idzikowski
staff answered 5 years ago
If you use an older version of the component (mdb-select):
Use template reference variable
#selecton the<mdb-select>element:Use
ViewChildto get access to the select element in the Typescript file:@ViewChild('select') select: SelectComponent
Use select
clear()method to clear the selections:clearSelection() { this.select.clear(); }
This public method is currently not available in the new version (mdb-select-2), but this problem should be fixed in the near future.
FREE CONSULTATION
Hire our experts to build a dedicated project. We'll analyze your business requirements, for free.
Answered
- User: Pro
- Premium support: Yes
- Technology: MDB Angular
- MDB Version: 6.2.3
- Device: PC
- Browser: Chrome
- OS: Windows
- Provided sample code: Yes
- Provided link: No