I'm trying to load HTML from my server and insert it somewhere in my angular app. It works well with static HTML, but if I want to use interpolation or components in this HTML via [innerHMTL] angular doesn't compile this code automatically.
So for example:
<div [innerHTML]="'<p>{{\'test123\'}}</p><button (click)=\"test()\">test</button><hello-world-cmp></hello-world-cmp>'">
Should result in a paragraph without the curly brackets with the text test123
, and a button with a actual click event triggering the method attached in the component TS file. Further more hello-world-cmp should be rendered as well.
I thought a third party module like ng-dynamic could do the trick. But it seems this requires JIT which is no longer usable for production builds. Is there any way of achieving this type of functionality?