I have an Angular application developed in Angular version 8 which has n number of components. There is a common logic that needs to be executed for all the component's initialization in the application. I don't want to keep this common logic in a shared service and call it from the constructor or ngOninit life cycle hook of all the components. The reason for this is we have different developers who keep adding new components to the application and this common logic needs to be executed for those new components as well and lot of my time is getting consumed for telling the developers about this logic.
Is there a way to override the angular component initialization step from the angular core library to put my common logic so that this common logic gets executed for every component's initialization and saves my time from asking every developer to inject my shared service and call it from their component's ngOninit.
And this common logic is not a very complicated logic. It is just a simple Rest API call that registers the component's information in a file for logging purpose.