mirror of
https://github.com/angular/angular
synced 2026-05-24 09:28:37 +00:00
`importProvidersFrom` provides a bridge from the world of NgModule-based DI configuration to the new, "standalone" world of direct providers and environment injectors. Early user feedback suggested some confusion around where this function was supposed to be used, particularly around importing NgModule-based providers into standalone component `providers` arrays, which is not the intended use. This confusion is exacerbated by the fact that due to the unified `Provider` type, this kind of misconfiguration was happily accepted by the type system. This commit changes the return type of `importProvidersFrom` to wrap the returned providers in an opaque type that prevents them from being used in component provider contexts. This, together with stronger documentation around the purpose and functionality of `importProvidersFrom`, should address some of the above confusion. PR Close #45838 |
||
|---|---|---|
| .. | ||
| init | ||
| src | ||
| test | ||
| testing | ||
| BUILD.bazel | ||
| index.ts | ||
| package.json | ||
| PACKAGE.md | ||
| public_api.ts | ||