I wanted to receive an HTML data via service call to server(this is for sure. I cannot keep templates in local) and manipulate them internally on how to show it(either as a modal or full page). This HTML with Angular tags should be looped to a component and work together. At most kind of $compile in Angular JS.
I am developing the solution in Angular 5 and should be compatible with AOT compiler. I had referred several solutions and landed to confusion on the deprecated and updated solutions. Please help me. I believe your updated answer would help many other people as well.. Thank you so much in advance!
For rendering HTML on the fly, you need DomSanitizer. E.g. something like this:
Now, that's the gist of it. You obviously also need a loading mechanic. You might also want to include some data into this block - if it's simple data, it can be on the fly:
For more complex scenarios you might need to create a dynamic component.
Edit: an example of a component resolved dynamically. With this, you create a component on-the-fly from server-sent html.
A simple dynamic component class and template
thanks: Zlatko
Use function instead class