How to pass form array index to getCities function in ng-bootstrap typehead including current input text. Consider 3 is form array index.
address.component.html
<input name="city" type="text" id="city" formControlName="city" [ngbTypeahead]="getCities">
address.component.ts
getCities = (text$: Observable<string>) =>
text$
.debounceTime(300)
.distinctUntilChanged()
.switchMap(query =>
query.length < 2 ? [] : this.apiService.getCities(query).catch(() => {
return Observable.of([]);
});)