我正在尝试从方法中获取值并将其用于图形,但是当我尝试获取值时,它显示为空。
TS
`bgs= [];
getbgs() {
this.bgsService.getbgss(this.token).subscribe(
data => {
this.bgs = data.map(k => k.bgs);
console.log(this.bgs); // I can get the value here
}
);
}
public lineChartData: Array<any> = [
{ data: [this.bgs], label: 'Series A' },
console.log("chart:" + this.bgs) // here the bgs is showing null .
];`
答案 0 :(得分:0)
可以。
assignee:stevage is:issue is:open sort:interactions-asc