我在Angular 6上持续收到以下错误:
core.js:1673 ERROR TypeError: res.Data.pipe is not a function
这是我的代码在这里:
this._prices.getHistoricalPrices(this.symbol, prefix, timeLimit, aggregate).subscribe(res => {
if (environment.production === false) {
console.log(res.Data);
console.log(res.Data.length);
}
priceChart = res.Data.pipe(map(res.close));
allDates = res.Data.pipe(map(res.time));
if (environment.production === false) {
console.log(priceChart);
}
cryptoDates = [];
allDates.forEach(() => {
const jsDate = new Date(res * 1000);
cryptoDates.push(jsDate.toLocaleTimeString([], { day: 'numeric', month: 'short', hour: '2-digit', minute: '2-digit' }));
});
// Draw new chart
this.chart = new Chart(canvasId, {
type: 'LineWithLine',
data: {
labels: cryptoDates,
datasets: [
{
data: priceChart,
borderColor: '#60acf3',
cubicInterpolationMode: 'monotone',
fill: false
}
]
},
options: this.chartOptions
});
});
我包括了fuller segment here。我要创建的页面的示例是here。