I am currently troubleshooting column positions within my application and need to inspect the sorted column definition. After retrieving the column definition from my API, I proceed to sort them. However, I also want to log the sorted list/Array to my console for verification purposes. Where can I locate and access the sorted list in the code snippet below?
fetchColumnsAgGrid(guid: string): Observable<IGridColumnAgGrid[]> {
return this.api.get({endpoint: `/sample/getgrid/${guid}`, useAuthUrl: false})
.pipe(
map((res: any) => {
console.log(res)
return res.Data && res.Data.map((column) => {
return GridColumnsService.adaptAgGridColumn(column);
}).sort((a, b) => {
if (a.position < b.position) {
return -1;
}
if (a.position > b.position) {
return 1;
}
return 0;
});
}),
);
}