Seperate electron and web target building

This commit is contained in:
Farkas József
2017-01-20 02:03:27 +01:00
committed by József Farkas
parent 517aed1b1c
commit 983eb72892
276 changed files with 2154 additions and 95 deletions

View File

@@ -0,0 +1,21 @@
import { Directive, ElementRef, HostListener, Renderer } from '@angular/core';
@Directive({
selector: '[cancelable]'
})
export class CancelableDirective {
private originalValue: string;
constructor(private elementRef: ElementRef, private renderer: Renderer) { }
@HostListener('focus') onFocus(): void {
this.originalValue = this.elementRef.nativeElement.value;
}
@HostListener('keyup.escape') onEscape(): void {
this.renderer.setElementProperty(this.elementRef.nativeElement, 'value', this.originalValue);
this.renderer.invokeElementMethod(this.elementRef.nativeElement, 'blur');
}
}

View File

@@ -0,0 +1 @@
export { CancelableDirective } from './cancelable.directive';

View File

@@ -0,0 +1 @@
export * from './cancelable';