【发布时间】:2020-05-22 04:06:08
【问题描述】:
我正在使用以下版本:
- @ngrx/effects@8.6.0
- @ngrx/store@8.6.0
@ngrx/core@1.2.0
@angular/cli@8.3.25
进口:
import { BookService } from './../services/book.service';
import {Actions, Effect, ofType} from '@ngrx/effects';
import {mergeMap, map} from 'rxjs/operators';
import {Action} from '@ngrx/store';
import * as types from './action.types';
import * as bookActions from './book.actions';
构造函数:
constructor(private service: BookService,
private actions$: Actions){}
@Effect() loadBooks$: Observable<Action> = this.actions$.pipe(
ofType<bookActions.loadBooksAction>(types.LOAD_BOOKS),
mergeMap(() =>
this.service.getAllBooks().pipe(map(books =>
new bookActions.loadBooksSuccessAction(books)))
)
)
错误:“操作”类型上不存在属性“管道”。
【问题讨论】:
-
请分享您的导入,我认为有错误。
-
好的,请也显示你的构造函数。
-
在问题中更新
标签: angular typescript redux rxjs ngrx