I'm writing an Angular 2 application, that in some parts needs to render HTML that is loaded from an external API.
This works fine for pure, static HTML by using angulars [innerHTML] directive:
<div [innerHtml]="htmlToBeRendered"> </div>
The HTML that is beeing injected is loaded from an Content Management System. Sometimes this HTML needs to have some Javascript-Code for pure "UI" purposes (some simple DOM-Manipulation within the injected HTML). This will be vanilla JS and won't rely on some other frameworks like JQuery.
Is there a way to keep this JS code while binding it to the dom via angular? Currently all JS code is beeing removed by Angular.
I know that this is a security feature, but the API from where the HTML is loaded can be considered a "safe" source.