I am developing dynamic template creation based on following example. example but i can't get html output. i.e) dynamic content. ts file:
@Component({
selector: 'product-item',
template: `
<div class="product">
<ng-container *compile="template; context: this"></ng-container>
</div>`,
})
export class DynamicItemComponent {
@Input() content: string = `<a (click)='changeEditor('TEXT')'>Click me</a>`;
@Input() template: string = `{{content}}`;
}
Html:
<product-item [content]="selectedTemplate.content"></product-item>
how can i get html output. i already used safethtml pipe, that is also not working. Thanks in advance.