0

A 3rd party library I use allows dynamic content to be added with html string. I can retrieve the HTMLElement it created. Is it possible to "compile" this HTMLElement so it behaves as-if it was defined in my component template?

Hopefully my question is clear, if not I could elaborate on it further.

Thanks in advance

MMG-Bas
  • 1
  • 2
  • Same as unanswered q http://stackoverflow.com/questions/40499827/how-to-use-string-retrieved-from-back-end-as-template-in-angular2/40500239 – Gavin Haynes Nov 21 '16 at 19:40

1 Answers1

0

I did not manage to exactly achieve what I asked, but I used the following solution.

I created similar dynamic content in my template and using a Query (in my case ContentChildren). I retrieved them and used Renderer.projectNodes to place them in the HTMLElement of the 3rd party library.

MMG-Bas
  • 1
  • 2