angular6 - Angular 6 ng lint select 已弃用
问题描述
我得到了 tslint 警告select is deprecated: from 6.1.0. Use the pipeable
'select' operator instead.
我的选择器如下所示
private availableStudents$ = this.store.select(getAvailableStudents);
还有我的 package.json
"rxjs": "^6.0.0"
"tslint": "~5.9.1"
"typescript": "^2.9.2"
"@angular/cli": "~6.1.2
解决方案
尝试以下操作:
private availableStudents$ = this.store.pipe(select(getAvailableStudents));
上面使用了警告中建议的 pipeable 运算符。
并确保导入它:
import { Store, select } from '@ngrx/store';
推荐阅读
- php - Nodejs重定向返回NULL
- html - 为什么我的 a:hover 不起作用,并且我的标签在点击时不会链接到链接?
- php - 合并/乘以数组中的缺失值
- image - 如果您必须使用 `new Image` 在 WebGL 中渲染图像
- web - 网站阻止我从 Tor 访问?
- shopify - 是否可以使用 Shopify API 获取订单推荐代码?
- ms-access - 将分层 PDF 嵌入 Access 数据库
- html - 悬停蓝线问题
- ios - 在 codepush 和 cocoapods 中找不到 React/RCTEventEmitter.h
- python - 如何防止用户在 Windows 上的 python 脚本中关闭我的 cmd 窗口