2020-04-14 11:28:33 +02:00
|
|
|
import { Component, Input, OnInit } from '@angular/core';
|
|
|
|
import { MessageService } from 'primeng/api';
|
2020-02-04 11:35:09 +01:00
|
|
|
|
|
|
|
@Component({
|
|
|
|
selector: 'framadate-copy-text',
|
|
|
|
templateUrl: './copy-text.component.html',
|
2020-04-14 11:28:33 +02:00
|
|
|
styleUrls: ['./copy-text.component.scss'],
|
2020-02-04 11:35:09 +01:00
|
|
|
})
|
|
|
|
export class CopyTextComponent implements OnInit {
|
|
|
|
@Input() public textToCopy: any;
|
2020-04-02 17:49:10 +02:00
|
|
|
displayContentToCopy = false;
|
2020-02-04 11:35:09 +01:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
constructor(private messageService: MessageService) {}
|
2020-02-04 11:35:09 +01:00
|
|
|
|
2020-04-14 11:28:33 +02:00
|
|
|
ngOnInit() {}
|
2020-02-04 11:35:09 +01:00
|
|
|
|
|
|
|
handleClick() {
|
|
|
|
this.messageService.add({
|
|
|
|
severity: 'success',
|
|
|
|
summary: 'Texte copié',
|
2020-04-14 11:28:33 +02:00
|
|
|
detail: this.textToCopy,
|
|
|
|
});
|
2020-02-04 11:35:09 +01:00
|
|
|
}
|
|
|
|
}
|