I want to inject html in my a-component with angular2 tags from another component.
@Component({
selector: \'app-root\',
template: \'
You can use Renderer2 Class for this.
import { ElementRef, Renderer2 } from '@angular/core';
constructor (
private elementRef: ElementRef,
private renderer: Renderer
) {}
public ngAfertViewInit(): void {
this.renderer
.setElementProperty(
this.elementRef.nativeElement,
'innerHTML',
' Nice Title
'
);
}