* // Individual module import
* import { CopyService } from 'patternfly-ng/copy';
* // Or
* import { CopyService } from 'patternfly-ng';
*
*/
@Injectable()
export class CopyService {
private verbose: boolean = false;
/**
* The default constructor
*/
constructor(@Inject(DOCUMENT) private _dom: any) {}
/**
* Accessor for testing purposes only
*
* @returns {any}
*/
get dom(): any {
return this._dom;
}
/**
* Copy a value to the user's system clipboard
*/
copy(value: string): boolean {
let result = false;
let textarea = this.dom.createElement('textarea');
const triggerElement =