importProvidersFrom in components (#45838)
`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
Angular - The modern web developer's platform.
Angular is a development platform for building mobile and desktop web applications
using Typescript/JavaScript and other languages.
Contributing Guidelines
·
Submit an Issue
·
Blog
Documentation
Get started with Angular, learn the fundamentals and explore advanced topics on our documentation website.
Advanced
Development Setup
Prerequisites
- Install Node.js which includes Node Package Manager
Setting Up a Project
Install the Angular CLI globally:
npm install -g @angular/cli
Create workspace:
ng new [PROJECT NAME]
Run the application:
cd [PROJECT NAME]
ng serve
Angular is cross-platform, fast, scalable, has incredible tooling, and is loved by millions.
Quickstart
Ecosystem
Changelog
Learn about the latest improvements.
Upgrading
Check out our upgrade guide to find out the best way to upgrade your project.
Contributing
Contributing Guidelines
Read through our contributing guidelines to learn about our submission process, coding rules and more.
Want to Help?
Want to report a bug, contribute some code, or improve documentation? Excellent! Read up on our guidelines for contributing and then check out one of our issues labeled as help wanted or good first issue.
Code of Conduct
Help us keep Angular open and inclusive. Please read and follow our Code of Conduct.
Community
Join the conversation and help the community.
Love Angular? Give our repo a star ⭐ ⬆️.
