My example is the next in the modal html:
<h1 mat-dialog-title class="title-dialog">
<b>{{ data.title }}</b>
</h1>
<div class="body_modal">
{{ data.body }}
</div>
modal code ts:
constructor( public dialogRef: MatDialogRef<GeneralComponent>,
@Inject(MAT_DIALOG_DATA) public data: any) {}
code in the component where I call the modal html:
<div class="col-md-2">
<div class="ico-image">
<img src="assets/icons/complete.svg" (click)="this.opening()"/>
</div>
</div>
<app-opening></app-opening>
code in the component where I call the modal ts:
showModal( name,body) {
const title = name;
const body = body;
const dialogConfig = new MatDialogConfig();
dialogConfig.disableClose = true;
dialogConfig.autoFocus = true;
dialogConfig.data = {
id: 1,
title: nombre_titulo,
body: body_graphic,
};
this.dialog.open(GeneralComponent, dialogConfig);
opening(){
console.log(true);
this.showModal(
"opening",
`<app-opening></app-opening>`
) }
With this code the modal is shown in text, I want to show the component inside the modal, thanks for your help