I have a problem with my application in Angular (with TypeScript language). I need to compare a string data field, such as "string4" with the NAME of an object. Example:
export class MyClass {
string1: string;
anyobject: Object;
string2: string;
// etc...
}
If I have a method such as:
myMethod(parameter: string) {
}
I want the value inside the parameter match as the name of a data field in my MyClass. For example, is parameter has value "string2", I want to get the string2 value of MyClass (that will be another string).