Title | Added | Status | Last reviewed |
---|---|---|---|
Clipboard directive |
v3.2.0 |
Active |
2019-04-12 |
Copies text to the clipboard.
<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>
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. |
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.