javascript - 角显示错误:ERROR TypeError: Cannot read property 'pipe' of undefined
问题描述
在模板中,我使用 mat-select 但在控制台中,显示以下问题。“错误类型错误:无法读取未定义的属性‘管道’”
我在这里没有使用任何管道,但为什么会出现?如果我注释掉(mat-select)部分,则不会出现错误。解决方案是什么?
// component.html file
<div class="grid-dropdown">
<mat-label>Choose Organization</mat-label>
<mat-select [(ngModel)]="selectedOrgId" placeholder="Select Org" name="batch" (selectionChange)="orgChange(selectedOrgId)">
<mat-option *ngFor="let option of loadedOrganization" [value]="option.org_id">{{ option.org_name }}</mat-option>
</mat-select>
</div>
// component.ts file
orgChange(e: any) {
console.log('selection works=>', e);
}
如果我选择任何选项,将触发 orgChange() 方法,并且应在 ts 文件中调用相应的方法。但这不会发生。我认为上述错误可能会导致此问题。
解决方案
推荐阅读
- python - 从用户输入,Python 在 SQL 中搜索电子邮件
- excel - 如何使用具有多个条件的嵌套 SUM 函数?
- angular - GET http://localhost:4200/profile/1 404(未找到)
- php - PHP GMP:POW,exp 必须是浮点数
- google-apps-script - 如何比较谷歌电子表格中的两个未排序的表格
- string - Groovy:有没有办法将未指定长度的字符串转换为从嵌套映射中获取对象的方法?
- firebase - 为 com.distriqt.Firebase 实现 com.google.protobuflite 时出错
- html - 由于溢出隐藏而导致文本未显示的问题
- php - Laravel 没有上传所有图片
- python - 启动后立即出现 Adafruit_GPIO ModuleNotFoundError