1 import {Component, Input, ViewChild, TemplateRef} from '@angular/core';
2 import {DialogComponent} from '@eg/share/dialog/dialog.component';
4 interface ClipboardValues {
10 selector: 'eg-clipboard-dialog',
11 templateUrl: './clipboard-dialog.component.html'
15 * Copy To Clipboard dialog
17 export class ClipboardDialogComponent extends DialogComponent {
19 @Input() values: ClipboardValues[];
21 copyValue(value: string) {
24 document.getElementById('clipboard-textarea') as HTMLTextAreaElement;
26 // Un-hide the textarea just long enough to copy its data.
27 // Using node.style instead of *ngIf for snappier show/hide.
28 node.style.visibility = 'visible';
29 node.style.display = 'block';
34 document.execCommand('copy');
36 node.style.visibility = 'hidden';
37 node.style.display = 'none';