I'm having problems using @ViewChild because it is nested within two different ngIf.
My template looks something like this:
<div *ngIf="model">
<div *ngIf="otherModel">
<myComponent #myComponent></myComponent>
</div>
</div>
<div *ngIf="!model">
</div>
In template I use my ViewChild like:
@ViewChild("myComponent", {static: false}) myComponent: MyComponent;
Now my problem is that my ViewChild always results as undefined. If I delete the first *ngIf="model"
everything is working fine. But I guess I'm having trouble with two ngIfs.
Any suggestions?