不推荐使用Angular 6 ng lint select

Jey*_*ani 2 ngrx angular6 rxjs6

我得到了tslint waring 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

Deb*_*ahK 5

请尝试以下方法:

private availableStudents$ = this.store.pipe(select(getAvailableStudents));
Run Code Online (Sandbox Code Playgroud)

以上使用警告中建议的可管道运算符.

并确保导入它:

import { Store, select } from '@ngrx/store';
Run Code Online (Sandbox Code Playgroud)

  • 他们可以更好地摇树.有关详细信息,请参阅此处:https://github.com/ngrx/platform/issues/876 (2认同)