Skip to content

Instantly share code, notes, and snippets.

@vsavkin
Created November 5, 2018 16:31
Show Gist options
  • Save vsavkin/cad2d25eaba08773343d1e831d830410 to your computer and use it in GitHub Desktop.
Save vsavkin/cad2d25eaba08773343d1e831d830410 to your computer and use it in GitHub Desktop.
@Component({
template: `
<div #dynamic></div>
`
})
class DynamicContentCompoent {
@ViewChild('#dynamic') el: ElementRef;
constructor(private loader: CmsTemplateLoader) {}
afterViewInit() {
this.el.nativeElement.innerHtml = sanitize(this.loader.loadDynamicTemplate());
}
}
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment