-
Notifications
You must be signed in to change notification settings - Fork 26.2k
ngOnDestroy on providedIn: 'root'
service not called
#28927
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
Labels
area: core
Issues related to the framework runtime
Milestone
Comments
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Feb 23, 2019
Prior to this change, any provider that was independently resolved using its InjectableDef would not be considered when destroying the module it was requested from. This commit provides a fix for this issue by storing the resolved provider in the module's list of provider definitions. Fixes angular#28927
JoostK
added a commit
to JoostK/angular
that referenced
this issue
Feb 23, 2019
This test verifies that Ivy's module injector does not suffer from angular#28927 to prevent regressing on this behavior going forward.
14 tasks
Thanks for the StackBlitz, that helped in tracking down this issue. I opened PR #28943 to fix it. |
IgorMinar
pushed a commit
that referenced
this issue
Apr 5, 2019
DeveloperFromUkraine
pushed a commit
to DeveloperFromUkraine/angular
that referenced
this issue
Apr 11, 2019
Prior to this change, any provider that was independently resolved using its InjectableDef would not be considered when destroying the module it was requested from. This commit provides a fix for this issue by storing the resolved provider in the module's list of provider definitions. Fixes angular#28927 PR Close angular#28943
DeveloperFromUkraine
pushed a commit
to DeveloperFromUkraine/angular
that referenced
this issue
Apr 11, 2019
…ngular#28943) This test verifies that Ivy's module injector does not suffer from angular#28927 to prevent regressing on this behavior going forward. PR Close angular#28943
wKoza
pushed a commit
to wKoza/angular
that referenced
this issue
Apr 17, 2019
Prior to this change, any provider that was independently resolved using its InjectableDef would not be considered when destroying the module it was requested from. This commit provides a fix for this issue by storing the resolved provider in the module's list of provider definitions. Fixes angular#28927 PR Close angular#28943
wKoza
pushed a commit
to wKoza/angular
that referenced
this issue
Apr 17, 2019
…ngular#28943) This test verifies that Ivy's module injector does not suffer from angular#28927 to prevent regressing on this behavior going forward. PR Close angular#28943
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. |
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
angular 7.2.5 - reproduction: https://stackblitz.com/edit/angular-begg91
Issue
When you call
destroy()
on an application,ngOnDestroy
on services that are@Injectable({providedIn: 'root'})
, is never called.You see here, the constructor of
ServiceProvidedInRoot
is called in both bootstraps ... so it's not reused and should be parse of the livecycle. ButngOnDestroy
is not called if module is destroyed:This is currently an issue for as as we try to use angular/universal, but we can't tear down objects in services when provided in root.
The text was updated successfully, but these errors were encountered: