Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs(core): deprecate providedIn: NgModule and providedIn: 'any' #47616

Closed
wants to merge 1 commit into from

Commits on Oct 3, 2022

  1. docs(core): deprecate providedIn: NgModule and providedIn: 'any'

    This commit deprecates the above two forms of `providedIn`.
    
    DEPRECATED:
    
    - The ability to pass an `NgModule` to the `providedIn` option for
    `@Injectable` and `InjectionToken` is now deprecated.
    
    `providedIn: NgModule` was intended to be a tree-shakable alternative to
    NgModule providers. It does not have wide usage, and in most cases is used
    incorrectly, in circumstances where `providedIn: 'root'` should be
    preferred. If providers should truly be scoped to a specific NgModule, use
    `NgModule.providers` instead.
    
    - The ability to set `providedIn: 'any'` for an `@Injectable` or
    `InjectionToken` is now deprecated.
    
    `providedIn: 'any'` is an option with confusing semantics and is almost
    never used apart from a handful of esoteric cases internal to the framework.
    alxhub committed Oct 3, 2022
    Configuration menu
    Copy the full SHA
    f1043d9 View commit details
    Browse the repository at this point in the history