I have a modal service that takes an object as a parameter like this:
modal = {
title: My Modal,
body: template
}
This gets passed to a modal component that holds the template for the modal (using bootstrap 4).
<div class="modal-header">
<h4 class="modal-title">{{title}}</h4>
<button type="button" class="close" aria-label="Close" (click)="onCancel()">
<span aria-hidden="true">×</span>
</button>
</div>
<div class="modal-body" [innerHtml]="body | keepHtml"></div>
<div class="modal-footer">
<button (click)="onCancel()" class="btn">
<span>Cancel</span>
</button>
<button (click)="onOk()" class="btn btn-primary">
<span>Ok</span>
</button>
</div>
The body is passed through a sanitization pipe based on this: https://medium.com/@AAlakkad/angular-2-display-html-without-sanitizing-filtering-17499024b079
Everything works fine until I try to use a custom component selector in the body and it's not displayed. I don't get a sanitization error in the console. Anyone know why this is happening and how to fix it?