angular6 - Angular 6 ng lint select 已弃用

标签 angular6 ngrx rxjs6

我得到了 tslint waring select 已弃用:从 6.1.0 开始。使用可管道 改为“选择”运算符。

我的选择器如下所示

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));

上面使用了警告中建议的可管道运算符。

并确保导入它:

import { Store, select } from '@ngrx/store';

关于angular6 - Angular 6 ng lint select 已弃用,我们在Stack Overflow上找到一个类似的问题: https://stackoverflow.com/questions/51979412/

相关文章:

javascript - Angular 6 使用管道将字符串转换为 Html

使用http时angular 6未定义函数

angular - 使用 ActionReducerMap : "not assignable to type ' ActionReducerMap<AppState, Action> 注册 reducer 时出错

angular - 类型 'distinctUntilChanged' 上不存在属性 'Observable<Event>'

Angular 6 : How to make a set of service calls in parallel and process Data once all of them are completed

merge - 理解 rxjs6 中的合并(特别是 redux-observable)

angular - 错误中的错误 TS2688 : Cannot find type definition file for 'jest'

angular - 如何在 Angular 6 中使用 ngx-file-drop 上传前预览图像?

angular - Redux-Observable - 调度必须按顺序运行的多个操作

Angular rxjs Observable.timer 不是带导入的函数