这是我从数据库中获取数据的代码 - 工作。 我得到的数据没问题,但我有这条消息“错误TS2339:属性'ReturnValues'在类型'对象'上不存在。 “ 为什么我有此错误消息?
import {HttpClient} from '@angular/common/http';
import {Component, OnInit} from '@angular/core';
@Component({
selector: 'app-product',
templateUrl: './product.component.html',
styleUrls: ['./product.component.css']
})
export class ProductComponent {
title: string;
constructor(private http: HttpClient) {
}
ngOnInit(): void {
this.http.post('myUrl for request', {
APIVersion: '1',
Calls: [{
Function: 'getObject', Arguments: [
"Customer", [{
"column": "customerID",
"value": '0',
"operator": ">"
}],
[], //Sort Array
"", //Page
"", //Limit
[]
]
}],
Authentication: {
AccessToken: '7644c600394f1e23512c90602d5c78ca'
}
}).subscribe(data => {
console.log(data.ReturnValues[0].items)
// this.title=data.ReturnValues[0].items;
}, err => {console.log(err)})
}
}