Is it possible to programmatically clear the selection of an ng-select dropdown? I\'m wanting the equivalent behaviour of clicking the clear icon, but triggered programmatically
Here is solution from comment:
// Access ng-select
@ViewChild(NgSelectComponent) ngSelectComponent: NgSelectComponent;
// Call to clear
this.ngSelectComponent.handleClearClick();
Note that handleClearClick
isn't exposed in docs as public api method however as Tim mentioned it's public method so it's possible to call it.