Search code examples
htmltemplatesinheritanceangular6

Inheritance of component angular 6 templates


We know we can extend an angular component but I would like to also extend the template associated. I mean, for instance, I could define an abstract component with its template with kind of skeleton, and then in the children would be forced to implements not only the abstract class methods and so on, but also the "empty gaps" of the skeleton html template.

Up to now, I have to completely redefine the template in the child. I know that I could create another component but that a relationship by association. It's annoying because I have to create an abstract class to be extend and then a component to redefine the template.

How do you do that?


Solution

  • This is not possible. What could be useful to you is content projection

    https://blog.angular-university.io/angular-ng-content/