我有效果类,我想根据路由器参数 ID 加载详细信息
@Effect()
getDetails$ = this.actions$.ofType(DetailActions.GET_DETAILS).pipe(
map(toPayload),
switchMap(payload => {
return this.detailService
.getDetail(payload)//I want router params here in payload
.pipe(
map(detail=> new DetailActions.GetDetailSuccess(detail)),
catchError(error =>
Observable.of(new DetailActions.GetDetailFail(error))
)
);
})
);
我想在有效负载中获取路由器参数,这样我就不必从组件传递有效负载,而是直接从效果类中获取它。