This is my app.component.html:
<div #content>
Hello world
<ng-template>
inside template
</ng-template>
</div>
And this is my app.component.ts
@ViewChild('content', { read: ElementRef }) refContent: ElementRef;
...
console.log(this.refContent.nativeElement);
And this is the output:
<div _ngcontent-kst-c255="">
Hello world
<!--container-->
</div>
How to get the console to print like this?
<div _ngcontent-kst-c255="">
Hello world
inside template
</div>
I put a timeout of 1000 ms before calling
And it works now. The renderer just need some time to render it.