Annotations are not inherited, so if you have:
@Directive({ selector:'foo', inputs:['bar'] }) export class Foo {}
FooBar will not be recognized as a directive at all, and FooBaz will, but it will not be the input of bar (or any other). So, if inheritance is really what makes the most sense for your use case, a way to get closer to this would be to declare input, etc. In annotations of the child class and passing them as constructor arguments to the parent of the class, where you can encapsulate the general functionality.
However, I do not think that extensibility necessarily implies inheritance, and, in my experience, the old adage “prefers composition over inheritance” is doubly true when DI is involved.
Someone who was much smarter than me recently said: “Inheritance will kill your children in a dream,” and I tend to stick to this point of view if I'm not sure if this is the right tool for my use case.
source share