During the angular 10 migration process, there is a recommendation that classes utilizing angular features should have a decorator. However, what should be done in cases where it's a base class shared by both Injectables and Directives (as it solely implements OnDestroy
)? Is it acceptable to use @Directive
and @Injectable
on the same class, or would it be better to split the class into two separate entities - one to be inherited by directives, and another by injectables?
Although it seems to compile without issues with the following structure, is this approach problematic:
@Injectable()
@Directive()
// tslint:disable-next-line:directive-class-suffix
export class SomeBaseClass implements OnDestroy
Useful links for reference: