I have a property of a component in Angular that looks like this:
export class CarComponent implements OnInit {
partNumber: number;
checkIfItHasAPartNumberProperty() {
return this.hasAProperty('partNumber');
}
What is Angular equivalent for hasAProperty to check if this class contains a definition of a property by string name, eg. "partNumber"?
It is not a question about getting value of "partNumber", or checking directly if it has property "partNumber", but check programmatically if a component has a property of a given name (by string).