这是我的 components.ts。我想编写一个按计数对数组进行排序的函数,我将使用 html 中的排序数组数据来创建图表。
import { Component } from '@angular/core';
@Component({
selector: 'dashboard',
styleUrls: ['./dashboard.scss'],
templateUrl: './dashboard.html',
})
export class Dashboard {
private data = [];
constructor() {
this.data = [{
'maxTime': 30041,
'minTime': 6453,
'avgTime': 18949,
'count': 4,
'requestRouteTemplate': 'api/GetUserPostponesCountReport',
'requestMethod': 'POST',
},
...
}
]