У меня есть наблюдаемое здесь из поиска в Википедии
https://ng -bootstrap.github.io / stackblitzes / машинописный / HTTP / stackblitz.html
export class NgbdTypeaheadHttp {
model: any;
searching = false;
searchFailed = false;
myfilter = ['Mary' , 'Maryland'];
constructor(private _service: WikipediaService) {}
search = (text$: Observable<string>) =>
text$.pipe(
debounceTime(300),
distinctUntilChanged(),
tap(() => this.searching = true),
switchMap(term =>
this._service.search(term).pipe(
tap(() => this.searchFailed = false),
catchError(() => {
this.searchFailed = true;
return of([]);
}))
),
tap(() => this.searching = false)
)
}
После оператора Switchmap в канале я хотел бы отфильтровать ответ.
Элементы для фильтрации сохраняются в списке myFilter.
Я застрял на том, как это сделать.