import { FocusOrigin } from '@angular/cdk/a11y' ; import { ChangeDetectorRef , Component , NgZone } from '@angular/core' ; title @ Component ( { selector : 'focus-monitor-directives-example' , templateUrl : 'focus-monitor-directives-example.html' , styleUrls : [ 'focus-monitor-directives-example.css' ] } ) export class FocusMonitorDirectivesExample { elementOrigin = this . formatOrigin ( null ) ; subtreeOrigin = this . formatOrigin ( null ) ; constructor ( private ngZone , private cdr ) { } formatOrigin ( origin ) { return origin ? origin + ' focused' : 'blurred' ; } markForCheck ( ) { this . ngZone . run ( ( ) => this . cdr . markForCheck ( ) ) ; } }