I want to render html to my template by passing variable (templateHtml) but is not render the html only text.
Any solution?
my template
<ion-content padding >
<div [innerHtml]="templateHtml"></div>
</ion-content>
my component
import {Component} from '@angular/core';
import { NavController } from 'ionic-angular';
@Component({
selector: 'page-home',
templateUrl: 'home.html'
})
export class HomePage {
templateHtml: any = `<button ion-button (click) = "testClick()">Test</button>`;
constructor(public navCtrl: NavController) {
}
testClick() {
console.log('click');
}
}