I want to present a list of items of coming from a service, and the items may be of different types. I need to display a different template for each item at runtime. Is there something that selects a template for each item in a collection based on its value or type? For example, xaml has the concept of a template selector.
Asked
Active
Viewed 172 times
-2
-
What's wrong with this question? – Owen Johnson Apr 16 '19 at 13:00
1 Answers
0
You can use NgSwitch
. Wrap the possible templates in a container, and put the ng switch directive on the container. Put an NgSwitchCase directive on each template. The matching cases will be visible.

Owen Johnson
- 2,416
- 2
- 19
- 23