redoc/lib/shared/components/SelectOnClick/select-on-click.directive.ts

18 lines
392 B
TypeScript
Raw Permalink Normal View History

2016-07-17 18:07:51 +03:00
'use strict';
import { Directive, HostListener, ElementRef} from '@angular/core';
import { Clipboard } from '../../../services/clipboard.service';
@Directive({
selector: '[select-on-click]'
})
export class SelectOnClick {
$element: any;
constructor(private element: ElementRef) {}
@HostListener('click')
onClick() {
Clipboard.selectElement(this.element.nativeElement);
}
}