Destroy the Injectable service in a component




How to destroy or make the Injectable service to nil in a component or in it own class?


It’s not typical for components to control the lifetime of services. Dependency injection and inversion of control (both used by angular) are meant to achieve the exact opposite. Do you mind providing more details about what you’re trying to achieve? I might be able to suggest an alternative design.

Here’s angular’s documentation on DI. They might have the info you’re looking for.