-
Notifications
You must be signed in to change notification settings - Fork 26.5k
Closed
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: bootstrapfeatureIssue that requests a new featureIssue that requests a new featurefeature: in backlogFeature request for which voting has completed and is now in the backlogFeature request for which voting has completed and is now in the backlogstate: has PR
Milestone
Description
Which @angular/* package(s) are relevant/related to the feature request?
core
Description
When developing with NgModules we were able to do:
const moduleRef = await platformBrowserDynamic().bootstrapModule(AppModule);
moduleRef.onDestroy(() => { /* some logic */ });
The new bootstrapApplication
now returns a ApplicationRef
. Although the onDestroy
method exists in ApplicationRef
, 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
(applicationRef as any).onDestroy(() => {});
or getting the reference to the first component and using its onDestroy
.
Metadata
Metadata
Assignees
Labels
area: coreIssues related to the framework runtimeIssues related to the framework runtimecore: bootstrapfeatureIssue that requests a new featureIssue that requests a new featurefeature: in backlogFeature request for which voting has completed and is now in the backlogFeature request for which voting has completed and is now in the backlogstate: has PR