Take the following template example. The Im creating a template context of user with the as syntax and would like to pass that context into the userTmpl. From what I can tell there's no way to pass context outside of what is used by the ngIf condition. Which in this example, is the showUser property.
<ng-container *ngIf="user$ | async as user">
<ng-container *ngIf="showUser; then userTmpl; else emptyTmpl"></ngcontainer>
</ng-container>
How can you pass the user template input variable to the nested templateRef?
Looking at the source, the ngIf directive looks like it sets the context to the condition of the ngIf. Im not aware of a way to basically override that context variable thats used within the templates
Something like this would be ideal, but not seeing a way to do it.
<ng-container *ngIf="showUser; then userTmpl; else emptyTmpl; context: user"></ngcontainer>