Here is the property and method
JavaScript
private errorMessages = new Map string>();
public get errors(): Array {
if (!this.control) {
return [];
}
const { errors } = this.control;
return Object.keys(errors).map(key => this.errorMessages.has(key) ?
this.errorMessages.get(key)() : errors[key] || key);
}I get this error on this on this part of the code
JavaScript
this.errorMessages.get(key)()Can someone explain why the problem as to why I'm getting this error and a possible solution to the problem?

Bohdan StupakRank #479 · 5.2K reputationPosted Nov 13, 2021, 10:10 AM EST