I'm utilizing ngbTypeahead for typeahead search feature, and I'm curious about passing parameters to the search function.
<input id="typeahead-basic" type="text" class="form-control" [(ngModel)]="model" [ngbTypeahead]="search(param1, param2)"/>
Angular
search = (text$: Observable<string>) =>
text$.pipe(
debounceTime(300),
distinctUntilChanged(),
tap(() => (this.searching = true)),
switchMap(term =>
this.underwritingServiceWrapper.search(term).pipe(
tap(() => (this.searchFailed = false)),
catchError(() => {
this.searchFailed = true;
return of([]);
})
)
),
tap(() => (this.searching = false))
)
I've tried troubleshooting this, but it doesn't seem to be functioning as expected. Angular 2 ng bootstrap typehead pass additional parameter
Could someone provide an example to help me out?