我有方法从BE获取数据
在这里
getChartsData(): any {
const documentStyle = getComputedStyle(document.documentElement);
const textColor = documentStyle.getPropertyValue('--text-color');
const textColorSecondary = documentStyle.getPropertyValue(
'--text-color-secondary'
);
const surfaceBorder = documentStyle.getPropertyValue('--surface-border');
this._testFileService.getFileData().subscribe((result) => {
console.log(result);
console.log(
result.map((obj: any) => {
obj.city;
})
);
}console.log(result);
返回369个对象的数组的问题
但是console.log( result.map((obj: any) => { obj.city; }) );
返回未定义
我该怎么解决这个问题?
我的问题是
1条答案
按热度按时间hmae6n7t1#
您缺少一个return语句:
你也可以缩短它,如果回报很简单,比如: