Internal component of MdTable

How to create the angular component <md-table>within and transmit <md-table>the content items (e.g. <md-header-row>, <md-header-cell>etc.)?

I tried to do this with <ng-container *ngTemplateOutlet="...">or with <ng-content>and <md-table>gives errors because I cannot find these elements.

Plunger Code Example

thank

+4
source share
1 answer

You can try with ng-content:

<myComponentWithDataTable>
    <md-header-row></md-header-row>
</myComponentWithDataTable>

In your component:

<md-table>
    <ng-content></ng-content>
</md-table>
0
source

Source: https://habr.com/ru/post/1685461/


All Articles