Answer the question
In order to leave comments, you need to log in
Do I need to specify providers in the child component?
Do I need to re-specify the dependency (service) in providers=[Service]
if it has already been defined in the main module or the child module in which the component is imported?
Answer the question
In order to leave comments, you need to log in
Here everything is described in detail https://angular.io/guide/providers
Here is a brief extract:
To answer your question: no, you don't need it if the service is already declared in the module.
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question