Providers and scope

A provider tells Angular's injector how to create a dependency and where it is available. providedIn: 'root' creates a single instance for the whole application; a provider declared on a component or a route gives an instance limited to that scope.

Example

bootstrapApplication(App, { providers: [provideHttpClient()] })

Related concepts

The whole glossary