I am working on a component called components.ts in my Angular project. My goal is to create a function that sorts an array based on counts, and then utilize the sorted data in my HTML to generate a chart.
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',
},
...
}
]