我从 Selected 服务选择器中获取 Id 和 ova,并希望将其解析为调用 API 端点的 GET 方法。这就是我所做的,但是在选择的服务页面加载时,当我记录数据时我得到空值。需要帮助。
@Effect()
loadService$ = this.actions$.ofType(servicesActions.LOAD_ONE_SERVICE)
.pipe(
switchMap(() => {
this.store.select(fromSelect.getSelectedService).subscribe(
data => {
this.id = data.merchantId,
this. ova = data.ova
}
)
return this.appservice
.getServiceById(
this.id,
this.ova
)
.pipe(
map(service => new servicesActions.LoadServiceSuccess(service)),
catchError(error => of (new servicesActions.LoadServiceFail(error)))
);
})
);