I have two Angular 2 components, <future-todos>
and <past-todos>
. Can I somehow load them dynamically as shown below?
component.ts
if (condition) {
list = 'future';
} else {
list = 'past';
}
component.html
<{{list}}-todos></{{list}}-todos>
My actual situation is more complex, and I've omitted a lot of code to simplify this example showing my needs.