<ng-container *ngIf="isTrue; else notTrue">
<app-child
[property1]="value"
[property2]="value"
[property3]="value"
(function1)="func($event)"
></app-child>
</ng-container>
<ng-template #notTrue>
<app-child
[property1]="value"
[property2]="value"
(function1)="func($event)"
></app-child>
</ng-template>
I need the child component inside <ng-template #notTrue>
to be initialized and rendered post the parent's afterViewInit()
hook. Any suggestions on how to achieve this? Thank you.
For your information, I am working with Angular 9.