<md-autocomplete ng-model="ctrl.searchText"
md-selected-item="ctrl.selectedItem"
md-selected-item-change="ctrl.selectedItemChange(item)"
md-search-text="ctrl.searchText"
md-search-text-change="ctrl.searchTextChange(ctrl.searchText)"
md-items="item in ctrl.querySearch(ctrl.searchText)"
md-item-text="item.display"
md-min-length="0"
placeholder="Start typing your search term here">
Above is the code for md-autocomplete
.
I am trying to figure out how to clear suggestions upon a specific action. When I attempt to set $this.possibles = null
, the cached suggestion results are not cleared as expected. Here's my current querySearch function:
function querySearch(query) {
var results = query ? $this.possibles.filter(createFilterFor(query)) : $this.possibles;
return results;
}
What can be done to effectively clear the suggestions? Any help would be appreciated.