I am making an api call and expecting a response from it which can be passed to 2nd api call but I am getting an error
ERROR TypeError: this.helperService.getPointIdbyTags(...)[0].pipe is not a function
on line .pipe(switchMap((resarray:any)=>{
TS code
someFunction(floor){
floor.entities.forEach(element => {
let desiredTempForZone;
this.getCurrentValue(element.name).subscribe((des) =>
{
currentTempForZone = des
});
console.log(currentTempForZone);
})
}
getCurrentValue(eleName){
let roomObj = this.getRoomObj(eleName);
let equipRef = roomObj.map(equip => equip.entities.filter(entity => entity.entities.length > 0)[0])[0];
return this.helperService.getPointIdbyTags(this.buildings, ['current',
'temp'], equipRef.referenceIDs.room)[0]
.pipe(switchMap((resarray:any)=>{
const res = resarray[0]
return this.siteService.getHisPointData(res, 'current')
.pipe(
map(this.helperService.stripHaystackTypeMapping),
)
}));
}
And then I am trying to pass it on to
switchMap((resarray:any)=>{
const res = resarray[0]
return this.siteService.getHisPointData(res, 'current')
See Question&Answers more detail:
os 与恶龙缠斗过久,自身亦成为恶龙;凝视深渊过久,深渊将回以凝视…