ngAfterViewInit()

in docs-content/examples-source/cdk/a11y/focus-monitor-overview/focus-monitor-overview-example.ts [31:44]


  ngAfterViewInit() {
    this._focusMonitor.monitor(this.element).subscribe(origin =>
      this._ngZone.run(() => {
        this.elementOrigin = this.formatOrigin(origin);
        this._cdr.markForCheck();
      }),
    );
    this._focusMonitor.monitor(this.subtree, true).subscribe(origin =>
      this._ngZone.run(() => {
        this.subtreeOrigin = this.formatOrigin(origin);
        this._cdr.markForCheck();
      }),
    );
  }