Mohit Sharma
Mohit Sharma

Reputation: 21

How to render component dynamically from server using API call?

I have a dynamic component, which is working with param (:pagename) its a dynamic page, I have some custom pages those are stored in Admin portal like I have customReport page on admin when I hit the URL with customReport, I call the Rest API on dynamic component and get response from API that contains like

result:[{html:Example,component:'component code here'}];

I want to bind that Html on dynamiccomponent.html and inject customReport.ts to use functions of this component.

Upvotes: 1

Views: 170

Answers (1)

İlker A.
İlker A.

Reputation: 11

Did you see this content? Angular Html Binding

<div [innerHTML]="html"></div>

Upvotes: 1

Related Questions