Skip to content

Latest commit

 

History

History
45 lines (32 loc) · 1.51 KB

clipboard.directive.md

File metadata and controls

45 lines (32 loc) · 1.51 KB
Title Added Status Last reviewed
Clipboard directive
v3.2.0
Active
2019-04-12

Copies text to the clipboard.

Basic Usage

<span adf-clipboard="translate_key" [clipboard-notification]="notify message">
    text to copy
</span>

<button adf-clipboard="translate_key" target="ref" [clipboard-notification]="notify message">
    Copy
</button>

Class members

Properties

Name Type Default value Description
message string Translation key or message for snackbar notification.
placeholder string Translation key or message for the tooltip.
target HTMLInputElement|HTMLTextAreaElement Reference to the HTML element containing the text to copy.

Details

Clicking on the decorated element will copy the text content of that element (or the element specified in the target property) to the clipboard.

Use the parameter to adf-clipboard to specify a tooltip message that will be shown when the user hovers the mouse over the element. You can also provide a snackbar message in the clipboard-notification property, which will appear when the copying is complete.

See also