我正在尝试使用'ng build --prod'进行构建。但是我收到了
之类的错误any []类型不存在属性管道。
search = (text$: Observable<string>) =>
text$.pipe(
debounceTime(300),
distinctUntilChanged(),
tap(() => this.searching = true),
switchMap(term => term.length < 2 ? []:
this._service.search(term).pipe(
tap(() => this.searchFailed = false),
catchError(() => {
this.searchFailed = true;
// return of([]);
return [];
}))
),
tap(() => this.searching = false)
)
<input id="typeahead-http" type="text" class="form-control" placeholder="Enter Product Name"
#input
(selectItem)="selectedItem($event,input)"
[class.is-invalid]="searchFailed"
[(ngModel)]="model"
[ngbTypeahead]="search"
[inputFormatter]="formatter"
[resultFormatter]="formatter" />
<span *ngIf="searching">searching...</span>
<div class="invalid-feedback" *ngIf="searchFailed">Sorry, this product could not be loaded.</div>