feat(core): Expose Injector.destroy on Injector created with …#60054
feat(core): Expose Injector.destroy on Injector created with …#60054JeanMeche wants to merge 1 commit intoangular:mainfrom
Injector.destroy on Injector created with …#60054Conversation
3c88a3a to
f1cf742
Compare
2c4e484 to
77bd499
Compare
77bd499 to
27d6098
Compare
27d6098 to
d4bd01b
Compare
|
@JeanMeche what's the benefit of this vs create environment injector now? When to use each? |
|
|
So I could create a function that creates an injector that is destroyed automatically with the node injector without destroy ref handling? |
|
Here is an example : https://stackblitz.com/edit/angular-factory-di?file=src%2Fmain.ts (not suggesting that you should exactly do that, but you can). |
Why do you need destroy ref though? Won't it die with the injector it was based on? So if called in component it will die with the component injector? |
|
Injectors don't have references to their child injectors. |
…ector.create` There is no implementation change, this only expose `destroy` in a case where the injector can be owned in userland.
d4bd01b to
2cd0426
Compare
Injector.destroy on Injector created with …Injector.destroy on Injector created with …
mmalerba
left a comment
There was a problem hiding this comment.
Reviewed-for: public-api
|
This PR was merged into the repository by commit 4812215. The changes were merged into the following branches: main |
|
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. |
…
Injector.createThere is no implementation change, this only expose
destroyin a case where the injector can be owned in userland.