You can configure injectors with providers at different levels of your application by setting a metadata value. The configuration can happen in one of three places,
@Injectable()decorator for the service itself
@NgModule()decorator for an NgModule
@Component()decorator for a component
If you like this question & answer and want to contribute, then write your question & answer and email to freewebmentor[@]gmail.com. Your question and answer will appear on FreeWebMentor.com and help other developers.