I want to call a private method in my component
Private Method:
private test(): void {
return true;
}
You could use
component['test']();
// OR in your component, add
callMethod() {
this.test();
}
But if I were you, I would remove the private attribute. In Javascript, there's no private attributes, only scopes.
If you want to test your method and you can't, it means you should change your code, not adapt your test to your code. That's how you get simple and efficient code.
(But again; that was just my two cents on your matter)