Answer the question
In order to leave comments, you need to log in
How to properly pass data to ng-template in Angular?
The task is to write a table component that will support templates.
An example of what I would like to have:
<my-table>
<table-column name="Some name"></table-column>
<table-column name="Some name2"></table-column>
<table-column name="Some name3">
<ng-template let-i="item">
<a routerLink="/someway/{{i.id}}">Link</a>
</ng-template>
</table-column>
</my-table>
Answer the question
In order to leave comments, you need to log in
it is not clear what exactly is needed and why there is a template at all. so only link https://toddmotto.com/angular-ngfor-template-eleme...
If the version is A1, then the data is passed (failed) through the prototypes (child scopes), and read access to them must be by name (for writing - through the parent object).
If A2, then you need to transfer through the properties of the components, in A2 there are no built-in templates out of the box.
In your example, there is no ngFor, what data is not being passed?
Didn't find what you were looking for?
Ask your questionAsk a Question
731 491 924 answers to any question