合并地图角度

问题描述 投票:0回答:1

你能告诉我我在做什么错吗?

this.scheduleService.GetZones(environment.systemId)
  .pipe(
    mergeMap((zone: Zone) => {
      return this.dashboardService.GetLatestMeasurementValue(environment.systemId, zone.sensorId)
    })
    .subscribe(mois => {
      this.currentMoisture = mois;
    })
  );
}

我收到此错误:类型'OperatorFunction'不存在属性'subscribe'

angular typescript ionic2 mergemap
1个回答
2
投票

您不能订阅运营商。您需要订阅如下。

this.scheduleService.GetZones(environment.systemId)
    .pipe(
       mergeMap((zone: Zone) => {
          return this.dashboardService.GetLatestMeasurementValue(environment.systemId, zone.sensorId);
       })
     )
    .subscribe(mois => {
      this.currentMoisture = mois;
    })
© www.soinside.com 2019 - 2024. All rights reserved.