Currently working on implementing ngbTypeAhead and encountering problems with RxJS version 5.5.5. The example I am referencing is from version 6 of rxjs.
"rxjs": "^5.5.2" and
angular "^5.0.1",
"typescript": "~2.6.1",
While trying to apply typeahead on focus, an error occurs:
*[ts] Property 'pipe' does not exist on type 'UnaryFunction<Observable<{}>, Observable<string | {}>>'.
any*
search2 = (text$: Observable<string>) => {
const debouncedText$ = text$.pipe(debounceTime(200), distinctUntilChanged());
const clicksWithClosedPopup$ = this.click$.pipe(filter(() => !this.instance.isPopupOpen()));
const inputFocus$ = this.focus$;
let mer = merge(debouncedText$, inputFocus$, clicksWithClosedPopup$);
debugger;
return mer.pipe(
map(term => (term === '' ? this.roadList
: this.roadList.filter(v => v.toLowerCase().indexOf(term.toString().toLowerCase()) > -1)).slice(0, 10))
);
}
Seeking assistance in resolving the issue with rewriting the search2 method above.