You cannot query for a reference defined in other component template, since each template is a black box to its relatives.
You have to add the following in the ModalComponent template <ng-template #template><ng-content></ng-content></ng-template> to capture the projected content you have defined inside the <app-modal> in the dashboard.
Then you can pass the templateRef in the dialog data and print the data.template content in the modal-dialog component using a template-outlet like <ng-container *ngTemplateOutlet="data.template"></ng-container>
Hi Ram,
You cannot query for a reference defined in other component template, since each template is a black box to its relatives.
You have to add the following in the ModalComponent template
<ng-template #template><ng-content></ng-content></ng-template>
to capture the projected content you have defined inside the<app-modal>
in the dashboard.modal.component.ts
Then you can pass the templateRef in the dialog data and print the
data.template
content in the modal-dialog component using a template-outlet like<ng-container *ngTemplateOutlet="data.template"></ng-container>
modal-dialog.component.html
Cheers