I have a backend database containing help manual topics in html format, including anchors with on click function. My Angular (4.3.5) app has a tree of topics, when a tree topic is clicked the topic's body html is got from the backend and displayed next to the topic tree in a container div.
My question is about how to display the html page in the container div. Initially I tried:
<div [innerHtml]="htmlbody | safeHtmlPipe"></div>
This solution did not fully work because the htmlbody contains anchors to other pages as:
<a (click)="loadNewPage(topicId)">display topic</a>
Angular is sanitizing (filtering out) the anchor on click handler.
I have followed many google links on this subject like Dynamically displaying elements containing HTML with (click) functions Angular 2. Also I have looked at a wrapper component as in Dynamic Injection in Angular 4. But failed to find any actual examples of working code that specifically provides loading html from a dynamic source (ex the backend). I would like to make use of the new ngComponentOutlet directive and have it AoT compatible.
Does anyone know how to achieve this?