ngOnInit() {
this._variableLayoutDocumentService.countAllTrainDocuments().subscribe((result: ListResultDtoOfDashboardCountDto) => {
if (result) {
for (let i = 0; i < result.length; i++) {
this.barChartData[0].data.push(result[i].ProceesedDocumentCount);
this.barChartData[1].data.push(result[i].UnProceesedDocumentCount);
this.barChartLabels.push(result[i].DocumentTypeName);
}
}
});
}
我在上面的代码中遇到一个错误: 属性“ length”在类型“ ListResultDtoOfDashboardCountDto”上不存在。ts(2339)
我正在从我的C#代码中获取DashboardCount DTO:
public class DashboardCountDto : EntityDto<long>
{
public int Total { get; set; }
public string DocumentTypeName { get; set; }
public int ProceesedDocumentCount { get; set; }
public int UnProceesedDocumentCount { get; set; }
}