0

I'm having a component that makes an http request in its ngOnInit function. This call retrieves the content of the page that can contains angular directives such as routerLink or even angular2 custom component.

I found the way to inject this content in a div (using the innerHTML property), however, the inserted content does not get compiled by "angular2" resulting in routerLink being just an attribute without effect. And of course, the components don't appear.

Is there a simple way to ask angular2 to compile the inserted HTML?

1

1 Answer 1

1

As far as i understand angular takes template html and generate js factory code from it. When component is loaded, there is no way to change specified template

Sign up to request clarification or add additional context in comments.

Comments

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.