Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

How to check which component/service is calling a method in a service in angular 2,4?

I want to check which component/service is calling the method of a certain service, without passing additional parameters. This needs to be checked in the service. Please mention if there's any way that this could be done.

like image 489
Pasan Sumanaratne Avatar asked Jan 10 '18 13:01

Pasan Sumanaratne


1 Answers

you could use console.trace() inside the service to find out which component is calling that service.

like image 188
ashley Avatar answered Sep 18 '22 08:09

ashley