I have MyService which is injected into ComponetA and ComponetB.
Is it possible to find out from which component is the MyService.myMethod() called?
@Injectable()
export class MyService {
public myMethod(): void {
console.log('called from component: ' + component);
}
}
Only solution would be to use a parameter which would be passed to the called function.
EDIT: Previous suggestion to refer here would not work because it only works without strict mode.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With