Is there any way in Angular 2 RC5 to retrieve the HTML from a component to then insert into the innerHTML
of another?
I am using a proprietary library that requires creating modal dialogs through an API that takes the "content" HTML:
create({ctrl: 'popup', options: {contents: INNERHTML, ...}})
I can create the Angular 2 component for the popup contents using regular Angular 2 Typescript, but how do I extract that component's HTML to "inject" into the INNERHTML of the create
API?
- Do I need to use the Angular 2
Compiler
class in@angular/core
? - Do I need to use a
@ViewChild
and if so, how?
I found these SOF questions that seem to deal with this problem, but they are for older versions of Angular 2 and do not work any more: