By default Angular is sanitizing potential unsafe content.
You can tell Angular to trust your content
import { DomSanitizer } from '@angular/platform-browser';
export class AppComponent {
constructor(private sanitizer:DomSanitizer){
this.html = sanitizer.bypassSecurityTrustHtml("Header
");
}
html;
}
StackBlitz example
See also https://stackoverflow.com/a/41089093/217408