"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "src/material-examples/focus-monitor-focus-via/focus-monitor-focus-via-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-focus-via-example.ts  (material2-7.3.4):focus-monitor-focus-via-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 Focusing with a specific FocusOrigin */ /** @title Focusing with a specific FocusOrigin */
@Component({ @Component({
selector: 'focus-monitor-focus-via-example', selector: 'focus-monitor-focus-via-example',
templateUrl: 'focus-monitor-focus-via-example.html', templateUrl: 'focus-monitor-focus-via-example.html',
styleUrls: ['focus-monitor-focus-via-example.css'] styleUrls: ['focus-monitor-focus-via-example.css']
}) })
export class FocusMonitorFocusViaExample implements OnDestroy, OnInit { export class FocusMonitorFocusViaExample implements OnDestroy, AfterViewInit {
@ViewChild('monitored') monitoredEl: ElementRef<HTMLElement>; @ViewChild('monitored') monitoredEl: ElementRef<HTMLElement>;
origin = this.formatOrigin(null); origin = this.formatOrigin(null);
constructor(public focusMonitor: FocusMonitor, constructor(public focusMonitor: FocusMonitor,
private cdr: ChangeDetectorRef, private cdr: ChangeDetectorRef,
private ngZone: NgZone) {} private ngZone: NgZone) {}
ngOnInit() { ngAfterViewInit() {
this.focusMonitor.monitor(this.monitoredEl) this.focusMonitor.monitor(this.monitoredEl)
.subscribe(origin => this.ngZone.run(() => { .subscribe(origin => this.ngZone.run(() => {
this.origin = this.formatOrigin(origin); this.origin = this.formatOrigin(origin);
this.cdr.markForCheck(); this.cdr.markForCheck();
})); }));
} }
ngOnDestroy() { ngOnDestroy() {
this.focusMonitor.stopMonitoring(this.monitoredEl); this.focusMonitor.stopMonitoring(this.monitoredEl);
} }
 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)