N
N
No Name2018-06-24 00:12:28
Angular
No Name, 2018-06-24 00:12:28

Angular: How to pass template to child component?

1. There is a child component, like:

<app-searchable-list [config]="searchableListConfig" [(dataItems)]="users"></app-searchable-list>

2. This component accepts settings, data and displays a list of items.
3. Depending on the data, the markup of the element in the list should be different.
4. Making a bunch of ng-if inside the component will be a hack.
How to pass template to child component?

Answer the question

In order to leave comments, you need to log in

Didn't find what you were looking for?

Ask your question

Ask a Question

731 491 924 answers to any question