2017-10-17 6 views
1

私は数日間このままでした。 を "角度/コア@"::私はデバウンスでmd-autocompleteを更新できません

は、私が使用してカスタムMD-オートコンプリートコンポーネントを持っている "4.2.6"、 "角度/材質@": "2.0.0-beta.8"、

最後のキーを押すたびにn秒後に遅れてサービスコールを起動する必要があります。 Moockの日付はすべて大丈夫ですが、サービスが少し遅れたときに。ブーム!!!!リストは表示されません。

this.filteredOptions

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.FilterList発売イベントをリストをペイントするために使用され、サービスにそこに呼び出します。次に、md-autocompleteに送信されたパラメータでオブジェクトを更新します

私はthis.changeDetectorRef.detectChanges()を使用しようとしましたが、更新しません。

ありがとうございました

答えて

0

偶数コンポーネントの偶数ハンドラも削除して、独自に追加してください。それは簡単です。

関連する問題