I have this class:
export class ResourceFactory {
AlgoliaAppId = "AlgoliaAppId";
// ...
private resetParams() {
this.AlgoliaAppId = "AlgoliaAppId";
// ...
}
public initTemplate(objectName, directiveArgs): Template {
this.resetParams(); // <-- Can I, in any possible way, prevent this line from running?
this.AlgoliaAppId = `${this.AlgoliaAppId}${objectName}`;
// ... [long function content which I don't want to duplicate]
}
}
I'm trying to extend the ResourceFactory class: I want to change the AlgoliaAppId name and prevent resetParams from running. (I cannot edit the original class).
Is there any way to override resetParams even though it's private, or at least somehow monkey-patch the initTemplate method so it won't run the line this.resetParams?