Looking to enhance the reactivity of my code, I want to render my view based on the properties of a class. How can I extract only the property names from a class and exclude methods?
For instance:
export class Customer {
customerNumber: string;
name: string;
salesContact: string;
salesContactEmailAddress: string;
salesContactNumber: string;
execContact: string;
constructor(data?: any) {
...
}
toJSON() {
...
}
clone() {
...
}
}
I'm aiming for the result to be an Array of strings like this:
fields: string[] = ["customerNumber", "name", "salesContact", "salesContactEmailAddress", "salesContactNumber", "execContact"];