2

In Angular 2, what is the best practice for rendering user-submitted HTML (from a markdown editor, for example) if you'd like to be able to create bindings to the elements rendered?

Currently, I'm rendering using innerHTML and a pipe that bypasses the sanitizer. Is this the only way to render this content? If so, is there a way to allow bindings, attribute directives and components within?

J. Adam Connor
  • 1,694
  • 3
  • 18
  • 35
  • 1
    Check this out: http://stackoverflow.com/questions/39771455/recursive-dynamic-template-compilation-in-angular2 – RobM Feb 11 '17 at 06:03
  • Did you find a solution to this problem, using innerHtml? – Ben Dec 21 '17 at 22:31

0 Answers0