Join GitHub today
GitHub is home to over 28 million developers working together to host and review code, manage projects, and build software together.Sign up
Factory provider type does not respect OnDestroy hook #22240
I'm submitting a...
If we provide a service with a
The behavior should not differ if using a type provider or a factory provider.
Minimal reproduction of the problem with instructions
Simple Demo: https://stackblitz.com/edit/angular-3azkmn
If you comment in the type provider, the
What is the motivation / use case for changing the behavior?
I have tried to destroy an angular application manually (by calling the NgModuleRef.destroy method) that contains an angular router. After the appliction is destroyed the routing events still fire. The cause for this is that the
Other issues might be that someone changes the provider type and is not aware of this limitation. Thus introducing subtle bugs into the appliction.
I do not exactly know where to look for a fix, but the