mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-05-12 17:04:57 +00:00
2.0 KiB
2.0 KiB
Title, Added, Status, Last reviewed
Title | Added | Status | Last reviewed |
---|---|---|---|
Clipboard service | v3.2.0 | Active | 2019-04-12 |
Clipboard service
Copies text to the clipboard.
Class members
Methods
- copyContentToClipboard(content:
string
, message:string
)
Copies a text string to the clipboard.- content:
string
- Text to copy - message:
string
- Snackbar message to alert when copying happens
- content:
- copyToClipboard(target:
HTMLInputElement
|
HTMLTextAreaElement
, message?:string
)
Copies text from an HTML element to the clipboard.- target:
HTMLInputElement
|
HTMLTextAreaElement
- HTML element to be copied - message:
string
- (Optional) Snackbar message to alert when copying happens
- target:
- isTargetValid(target:
HTMLInputElement
|
HTMLTextAreaElement
):boolean
Checks if the target element can have its text copied.- target:
HTMLInputElement
|
HTMLTextAreaElement
- Target HTML element - Returns
boolean
- True if the text can be copied, false otherwise
- target:
Details
Use copyContentToClipboard
to copy a text string or isTargetValid
and
copyToClipboard
to copy the content of an HTML element in the page. The
message
parameter specifies a snackbar message to alert the user when the
copying operation takes place.