Is it possible to extend a Template in Angular 2?

Viewed 12898

I am wondering if it's possible to take the html (and directives) that are already in one component's template and include them in some way in another component's template. This would be useful where one would be extending an existing component and would like to use its existing template but add some additional html/directives.

In Twig (a popular php templating library) for example it's possible to extend a template:

{% extends "base.html" %}

{% block title %}Index{% endblock %}
{% block head %}
    {{ parent() }}
    <style type="text/css">
        .important { color: #336699; }
    </style>
{% endblock %}
{% block content %}
    <h1>Index</h1>
    <p class="important">
        Welcome on my awesome homepage.
    </p>
{% endblock %}

Is there any such thing like this in Angular 2? Again I'm not looking to embed an existing component but instead extend one.

1 Answers
Related