forked from tykayn/funky-framadate-front
24 lines
722 B
TypeScript
24 lines
722 B
TypeScript
import { Component, Input, OnInit } from '@angular/core';
|
|
import { ClipboardService } from 'ngx-clipboard';
|
|
|
|
import { ToastService } from '../../../../src/app/core/services/toast.service';
|
|
|
|
@Component({
|
|
selector: 'app-copy-text',
|
|
templateUrl: './copy-text.component.html',
|
|
styleUrls: ['./copy-text.component.scss'],
|
|
})
|
|
export class CopyTextComponent implements OnInit {
|
|
@Input() public textToCopy: string;
|
|
public displayContentToCopy = false;
|
|
|
|
constructor(private _clipboardService: ClipboardService, private toastService: ToastService) {}
|
|
|
|
ngOnInit(): void {}
|
|
|
|
public copy(): void {
|
|
this._clipboardService.copyFromContent(this.textToCopy);
|
|
this.toastService.display(`Texte copié : ${this.textToCopy}`);
|
|
}
|
|
}
|