Let's pretend that I have an interface A, that I am declaring as a class by following the Angular style guide. This class has many properties, and I want to fetch them names without having to assign any value to them. How can I achieve this ?
Class A:
export class A {
property1: string;
property2: string;
...
property30: string;
}
I tried with instantiating a new object from this class and calling Object.keys and Object.getOwnPropertyNames but this two methods return an empty array because they are ignoring undefined value properties. Is there any way to bypass this behaviour ? Or am I breaking the JavaScript/TypeScript pattern ? :D