"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/material-examples/focus-monitor-overview/focus-monitor-overview-example.ts" between
material2-7.3.4.tar.gz and material2-7.3.5.tar.gz

About: material2 offers Material Design components for Angular.

focus-monitor-overview-example.ts  (material2-7.3.4):focus-monitor-overview-example.ts  (material2-7.3.5)
import {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y'; import {FocusMonitor, FocusOrigin} from '@angular/cdk/a11y';
import { import {
AfterViewInit,
ChangeDetectorRef, ChangeDetectorRef,
Component, Component,
ElementRef, ElementRef,
NgZone, NgZone,
OnDestroy, OnDestroy,
OnInit,
ViewChild ViewChild
} from '@angular/core'; } from '@angular/core';
/** @title Monitoring focus with FocusMonitor */ /** @title Monitoring focus with FocusMonitor */
@Component({ @Component({
selector: 'focus-monitor-overview-example', selector: 'focus-monitor-overview-example',
templateUrl: 'focus-monitor-overview-example.html', templateUrl: 'focus-monitor-overview-example.html',
styleUrls: ['focus-monitor-overview-example.css'] styleUrls: ['focus-monitor-overview-example.css']
}) })
export class FocusMonitorOverviewExample implements OnDestroy, OnInit { export class FocusMonitorOverviewExample implements OnDestroy, AfterViewInit {
@ViewChild('element') element: ElementRef<HTMLElement>; @ViewChild('element') element: ElementRef<HTMLElement>;
@ViewChild('subtree') subtree: ElementRef<HTMLElement>; @ViewChild('subtree') subtree: ElementRef<HTMLElement>;
elementOrigin = this.formatOrigin(null); elementOrigin = this.formatOrigin(null);
subtreeOrigin = this.formatOrigin(null); subtreeOrigin = this.formatOrigin(null);
constructor(private focusMonitor: FocusMonitor, constructor(private focusMonitor: FocusMonitor,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private ngZone: NgZone) {} private ngZone: NgZone) {}
ngOnInit() { ngAfterViewInit() {
this.focusMonitor.monitor(this.element) this.focusMonitor.monitor(this.element)
.subscribe(origin => this.ngZone.run(() => { .subscribe(origin => this.ngZone.run(() => {
this.elementOrigin = this.formatOrigin(origin); this.elementOrigin = this.formatOrigin(origin);
this.cdr.markForCheck(); this.cdr.markForCheck();
})); }));
this.focusMonitor.monitor(this.subtree, true) this.focusMonitor.monitor(this.subtree, true)
.subscribe(origin => this.ngZone.run(() => { .subscribe(origin => this.ngZone.run(() => {
this.subtreeOrigin = this.formatOrigin(origin); this.subtreeOrigin = this.formatOrigin(origin);
this.cdr.markForCheck(); this.cdr.markForCheck();
})); }));
 End of changes. 4 change blocks. 
3 lines changed or deleted 3 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)