File

src/app/ui/copy-text/copy-text.component.ts

Implements

OnInit

Metadata

selector framadate-copy-text
styleUrls ./copy-text.component.scss
templateUrl ./copy-text.component.html

Index

Methods
Inputs

Constructor

constructor(messageService: MessageService)
Parameters :
Name Type Optional
messageService MessageService No

Inputs

textToCopy
Type : any

Methods

handleClick
handleClick()
Returns : void
ngOnInit
ngOnInit()
Returns : void
import {Component, Input, OnInit} from '@angular/core';
import {MessageService} from "primeng/api";

@Component({
    selector: 'framadate-copy-text',
    templateUrl: './copy-text.component.html',
    styleUrls: ['./copy-text.component.scss']
})
export class CopyTextComponent implements OnInit {
    @Input() public textToCopy: any;

    constructor(private messageService: MessageService,) {
    }

    ngOnInit() {
    }

    handleClick() {
        this.messageService.add({
            severity: 'success',
            summary: 'Texte copiƩ',
            detail: this.textToCopy
        })
    }

}
<button
    (click)='handleClick()'
    [cbContent]="textToCopy"
    [ngxClipboard]
    class=" btn btn--primary btn--outline"
    id="copyLink" >
    <i class='fa fa-copy' ></i >
    {{"admin.copy_link" |translate}} " {{ textToCopy}}"
</button >

./copy-text.component.scss

Legend
Html element
Component
Html element with directive

result-matching ""

    No results matching ""