I'm trying inject multi child component into parent component with ElementRef, but something went wrong when I tried to get child component html
My child component
html: string = '';
constructor(private elementRef: ElementRef) { }
ngAfterContentInit() {
this.html = this.elementRef.nativeElement;
}
And I want to get that child HTML in my parent component
var textComponent = new TextStepComponent();
console.log(textComponent.html); << child component
How can I do this? or Another way?
All things of what I want is getting HTML of a component in another component
Please help!!
HTMLcode?