-
Notifications
You must be signed in to change notification settings - Fork 25.7k
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
ApplicationRef's onDestroy method should not be internal #49087
Comments
FYI, making @AndrewKushnir wasn't opposed to making it public if a use case arises ! |
This feature request is now candidate for our backlog! In the next phase, the community has 60 days to upvote. If the request receives more than 20 upvotes, we'll move it to our consideration list. You can find more details about the feature request process in our documentation. |
@AndrewKushnir if you're fine with it, I can do the PR to expose it. We use it in NativeScript to manage the Angular bootstrap and application launch/exit events. |
@edusperoni yes, that makes sense, feel free to open a PR 👍 |
This change exposes the onDestroy callback on the ApplicationRef as the public API. It is useful for cases where people need to execute cleanup logic on application teardown. Closes angular#49087
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. |
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
When developing with NgModules we were able to do:
The new
bootstrapApplication
now returns aApplicationRef
. Although theonDestroy
method exists inApplicationRef
, it's marked as internal and not exposed.Proposed solution
Make
ApplicationRef.onDestroy
not internal and part of the public API. This makes sense as well because.destroy()
and.destroyed
are part of the public API.Alternatives considered
or getting the reference to the first component and using its
onDestroy
.The text was updated successfully, but these errors were encountered: