This code not worked
@Component({
selector: ‘default-page’,
templateUrl: ‘./default-page.component.html’,
changeDetection: ChangeDetectionStrategy.OnPush
})
<ion-header>
</ion-header>
<ion-content>
<ng-content></ng-content>
</ion-content>
@Component({
selector: ‘auth-page’,
templateUrl: ‘./auth-page.component.html’,
changeDetection: ChangeDetectionStrategy.OnPush
})
<default-page>
this content hidden
</default-page>
Now i use workaround for correct work
@Component({
selector: ‘default-page’,
templateUrl: ‘./default-page.component.html’,
changeDetection: ChangeDetectionStrategy.OnPush
})
…
@ViewChild(‘workaround’)
workaround: TemplateRef;
…
<ng-template #workaround>
<ion-header>
</ion-header>
<ion-content>
<ng-content></ng-content>
</ion-content>
</ng-template>
@Component({
selector: ‘auth-page’,
templateUrl: ‘./auth-page.component.html’,
changeDetection: ChangeDetectionStrategy.OnPush
})
<ng-container *ngTemplateOutlet="defaultPage.workaround"></ng-container>
<default-page #defaultPage>
this content hidden
</default-page>
when work with moved to other component begin work correct?
sorry for my english
if give me work link to template on stackblitz with ionic 4 and angular, i am try write sample code for current problem