Using Angular, I am trying to utilize a service that has been injected through dependency injection as a value for a static variable.
Here is the scenario:
Starting with the constructor where the Helper Service is injected:
constructor(private _helperService: HelperService) {
}
My goal is to access this Service as follows:
public static readonly setDataFunction = ProductsComponent._helperService.setData;
However, I encounter the error message: Property '_helperService' does not exist on type 'typeof ProductsComponent'
This is a new challenge for me, and I am unsure how to incorporate the _helperService in a static constant.
I have searched for solutions without success, and I am seeking guidance on how to proceed.