I've read the article again. You open it with
"If we read the OnDestroy lifecycle hook api description Angular OnDestroy we can use it on services."
But, how do you came to that conclusion? The lifecycle is described for components and directives. Where do you read it could be used on sercices?
You may have misunderstood whats written for onDestroy(). Services are mentioned there, right, but its meant as example to use onDestroy on your component to unregister it from(!) services.
For further actions, you may consider blocking this person and/or reporting abuse
We're a place where coders share, stay up-to-date and grow their careers.
My articles is about services so providers and not directives. So the conclusion is for using ngOnDestroy on a service and NOT on a directive
I've read the article again. You open it with
"If we read the OnDestroy lifecycle hook api description Angular OnDestroy we can use it on services."
But, how do you came to that conclusion? The lifecycle is described for components and directives. Where do you read it could be used on sercices?
You may have misunderstood whats written for onDestroy(). Services are mentioned there, right, but its meant as example to use onDestroy on your component to unregister it from(!) services.