angular5 - ngbTypeahead 抛出异常
问题描述
当我尝试使用 ng-bootstrap (2.0.0) typeahead 组件时,我在库本身内部遇到了故障。我正在使用这个版本,因为我不能只升级到 Angular 6。这是我遇到的错误。
错误 TypeError: Object(...) is not a function
at new NgbTypeahead (typeahead.js:54)
at createClass (core.js:10382)
...
at Object.debugCreateEmbeddedView [as createEmbeddedView] (core.js:12294)
我像这样设置HTML:
<ng-template #listSelectionFormatter let-r="result">
<span (click)="onWorkerSelected(r)">{{r.wwid}} - {{r.fullName}}</span>
</ng-template>
<div class="form-group">
<label *ngIf="labelText" class="col-form-label" for="wwid">{{ labelText }}</label>
<input id="wwid" name="wwid" type="text"
class="form-control"
placeholder="Search by WWID, IDSID, Name or Email"
[ngModel]="ngModel"
[ngbTypeahead]="search"
[inputFormatter]="selectedResultsFormatter"
[resultTemplate]="listSelectionFormatter"
/>
<span *ngIf="searching">searching…</span>
<div class="invalid-feedback" *ngIf="searchFailed">Lookup failed.</div>
</div>
解决方案
推荐阅读
- python - 我如何将这样的数据导入 R 或 Python?
- r - 如何从r数据框中提取同一列两次
- azure - 查询未返回 TimeGenerated 列。请编辑查询并包含 TimeGenerated 列
- laravel - 错误:运行 composer update 命令后在 laravel 8 中使用护照 10
- sql - 用连接在 SQL 中求和 2 行
- python - TypeError:注册的事件必须是协程函数discord.py
- spring - 当从 amqp 转换消息发生错误时,弹簧整数 amqp 不会重试
- c# - C# VSTO - 如何将活动表保存到新的工作簿/新文件?
- python - 在python中读取具有动态名称的配置文件条目
- r - 有没有办法用 RD 对象制作数据框?