1
我已經與這個好幾天了。我無法更新與去抖動md-autocomplete
我有一個自定義的MD-自動填充組分: 「@角/芯」: 「4.2.6」, 「@角/材料」: 「2.0.0-beta.8」,
在最後一次按鍵通過'n'秒後,我需要延遲服務呼叫。一切都與莫剋日期沒關係,但是,當我有點從服務延遲。繁榮!!!!該列表不會出現。
filterAutocomplete() {
this.filteredOptions = this.autocompleteControl.valueChanges
.startWith(null)
// delay
.debounceTime(this.autoProperties.time)
// call service method
.map(textSearch => this.FilterList(textSearch))
// unique event
.distinctUntilChanged();
}
FilterList(textSearch: string): any[] {
this.ref.detectChanges();
this.searchEmiter.emit(textSearch ? textSearch : '');
return this.listReg;
}
this.filteredOptions
用於
this.FilterList
啓動事件畫列表的視圖中的父親,有來電的服務。然後,用參數發送給md-autocomplete更新對象
我試過用this.changeDetectorRef.detectChanges()
但是不更新。
感謝