angular-extensions / lint-rules

tslint rules useful for angular projects

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

component containing subscribe must implement the ngOnDestroy() method on imported parent class

MaurizioPz opened this issue · comments

When the class that subscribes to an Observable extends a base class that handles the ngOnDestroy pattern, and this base class is from an external library, the rule emits a false error.

It works fine if the base class is in the same project

hi @MaurizioPz

Thanks for reporting this issue!
Unfortunately, this is a limitation of this project, since the code of an external library class cannot be analyzed and thus the extending class needs to implement the ngOnDestroy pattern as well.

If you have a solution in mind, please let me know!