In my component, I have a variable named "myVar" that determines which ng-template should be displayed. Let's consider the following example of a component template:
<div *ngIf="myVar; then myVar; else nothing"></div>
<ng-template #foo>My Foo-Content</ng-template>
<ng-template #nothing>No Content</ng-template>
Is there a way to make this setup work? I want "myVar" to either be null or equal the name "foo", but the current code doesn't evaluate "myVar".
Alternatively, is there a workaround for this issue? In my actual application, I have around 10 different values for "myVar", but the content isn't sufficient to justify creating separate components.
Do I really need to create 10 different *ngIf's for this scenario? :(