-
Notifications
You must be signed in to change notification settings - Fork 26.2k
fix(core): avoid eager providers re-initialization #23559
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
Conversation
14cf75b
to
63754eb
Compare
You can preview 63754eb at https://pr23559-63754eb.ngbuilds.io/. |
packages/core/src/view/ng_module.ts
Outdated
@@ -68,7 +68,9 @@ export function initNgModule(data: NgModuleData) { | |||
for (let i = 0; i < def.providers.length; i++) { | |||
const provDef = def.providers[i]; | |||
if (!(provDef.flags & NodeFlags.LazyProvider)) { | |||
providers[i] = _createProviderInstance(data, provDef); | |||
if (providers[i] === undefined) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
please add a comment
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.
63754eb
to
961e19f
Compare
You can preview 961e19f at https://pr23559-961e19f.ngbuilds.io/. |
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete. PR Close #23559
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete. PR Close #23559
This issue has been automatically locked due to inactivity. Read more about our automatic conversation locking policy. This action has been performed automatically by a bot. |
Fix a corner case where eager providers were getting constructed twice if the provider was requested before the initialization of the NgModule is complete.
PR Checklist
Please check if your PR fulfills the following requirements:
PR Type
What kind of change does this PR introduce?
Does this PR introduce a breaking change?