Hi! Thanks for answering, guys!
Recreating the problem online would be much more difficult that just explaining it, because there are a lot of elements involved. I’ll try:
I have some services in my app which have data that I’d like to reset when the user logs out.
I have a parent component that is only shown when the user is logged in so if I include those services in the providers array of that component decorator, every time the user logs out, this component is destroyed, and the services instances are deleted as well. If another user logs in, this parent component would be created again with new services instances, thus fulfilling my needs.
This works well, but if I use a resolver that needs data from one (or more) of those services instances, how would I inject them in the resolver? Maybe the idea that I had on resetting those services data is not well thought, and should use an alternative (like a subject the services subscribe to, and emits on logout), but I find it really clean and seamless, since when I need to include another service that has data that needs to be reset on logout I would only have to add it to the parent component providers array.