@Component({
templateUrl: 'your-smarty-template.php'
})
@Component({
template: '<div [innerHTML]="myHtml"></div>'
})
export class MyComponent implements OnInit {
myHtml?: SafeHtml;
constructor(private _http: Http, private _sanitizer: DomSanitizer) {
}
ngOnInit() {
this._http.get("your-smarty-template.php")
.subscribe(response =>
this.myHtml = this._sanitizer.bypassSecurityTrustHtml(response.text()));
}
}