Loan account creation and modification with Loan schedule type validation

This commit is contained in:
Jose Alberto Hernandez
2024-01-04 14:18:50 +01:00
committed by Adam Saghy
parent f6261be8d5
commit 80b821838c
21 changed files with 103 additions and 34 deletions
+21
View File
@@ -0,0 +1,21 @@
import { Injectable } from '@angular/core';
@Injectable({
providedIn: 'root'
})
export class Commons {
constructor() {}
public dynamicSort(property: string) {
let sortOrder = 1;
if (property[0] === '-') {
sortOrder = -1;
property = property.substr(1);
}
return (a: any, b: any) => {
const result = (a[property] < b[property]) ? -1 : (a[property] > b[property]) ? 1 : 0;
return result * sortOrder;
};
}
}