How to Get ElementRef DOM

ElementRef exposes nativeElement in which you could access its HTML DOM.

ng-now.component.ts

import { Component, ContentChild, AfterContentInit, ElementRef } from '@angular/core';

@Component({
  selector: 'app-ng-now',
  template: `
    <div>
      This is the View

      <ng-content></ng-content>
    </div>
  `
})

export class NgNowComponent implements AfterContentInit {
  @ContentChild('theElement') theElement: ElementRef;

  constructor() { }

  ngAfterContentInit() {
    console.log('======== Get ElementRef DOM');
    console.log(this.theElement.nativeElement.innerHTML);
  }

}

app.component.html

<app-ng-now>
    <div #theElement>
        <span>the element goes here</span>
    </div>
</app-ng-now>

How to Get EmbeddedViewRef DOM

EmbeddedViewRef allows you to get its HTML DOM from its rootNodes properties.

ng-now.component.ts

import { Component ViewChild, ContentChild, TemplateRef, ViewContainerRef, AfterContentInit, EmbeddedViewRef } from '@angular/core';

@Component({
  selector: 'app-ng-now',
  template: `
    <div #theView>
      This is the View
    </div>
`
})

export class NgNowComponent implements AfterContentInit {
  @ContentChild(TemplateRef) theTemplate: TemplateRef;
  @ViewChild('theView', { read: ViewContainerRef }) theViewContainerRef: ViewContainerRef;
  theEmbView: EmbeddedViewRef;

  constructor() { }

  ngAfterContentInit() {
    this.theEmbView = this.theViewContainerRef.createEmbeddedView(this.theTemplate);

    console.log('============ Get EmbeddedViewRef DOM')
    console.log(this.theEmbView.rootNodes[0]);
  }
}

app.component.html

<app-ng-now>
    <ng-template>
        <span>the template goes here</span>
    </ng-template>
</app-ng-now>