W3cubDocs

/Angular

EnvironmentProviders

Encapsulated Providers that are only accepted during creation of an EnvironmentInjector (e.g. in an NgModule).

API

type EnvironmentProviders = {
  ɵbrand: 'EnvironmentProviders';
}

Description

Encapsulated Providers that are only accepted during creation of an EnvironmentInjector (e.g. in an NgModule).

Using this wrapper type prevents providers which are only designed to work in application/environment injectors from being accidentally included in @Component.providers and ending up in a component injector.

This wrapper type prevents access to the Providers inside.

Super-powered by Google ©2010–2025.
Code licensed under an MIT-style License. Documentation licensed under CC BY 4.0.
https://angular.dev/api/core/EnvironmentProviders