mirror of
https://github.com/Alfresco/alfresco-ng2-components.git
synced 2025-07-24 17:32:15 +00:00
[ADF-4391] Doc review for 3.2 (#4601)
* [ADF-4391] Reviewed new clipboard class docs * [ADF-4391] Reviewed new proc cloud class docs * [ADF-4391] Reviewed new datatable doc additions
This commit is contained in:
committed by
Eugenio Romano
parent
16aaa0f0b3
commit
921fdc00df
38
docs/core/services/clipboard.service.md
Normal file
38
docs/core/services/clipboard.service.md
Normal file
@@ -0,0 +1,38 @@
|
||||
---
|
||||
Title: Clipboard service
|
||||
Added: v3.2.0
|
||||
Status: Active
|
||||
Last reviewed: 2019-04-12
|
||||
---
|
||||
|
||||
# [Clipboard service](../../../lib/core/clipboard/clipboard.service.ts "Defined in clipboard.service.ts")
|
||||
|
||||
Copies text to the clipboard.
|
||||
|
||||
## Class members
|
||||
|
||||
### Methods
|
||||
|
||||
- **copyContentToClipboard**(content: `string`, message: `string`)<br/>
|
||||
Copies a text string to the clipboard.
|
||||
- _content:_ `string` - Text to copy
|
||||
- _message:_ `string` - Snackbar message to alert when copying happens
|
||||
- **copyToClipboard**(target: [`HTMLInputElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement)`|`[`HTMLTextAreaElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement), message?: `string`)<br/>
|
||||
Copies text from an HTML element to the clipboard.
|
||||
- _target:_ [`HTMLInputElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement)`|`[`HTMLTextAreaElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement) - HTML element to be copied
|
||||
- _message:_ `string` - (Optional) Snackbar message to alert when copying happens
|
||||
- **isTargetValid**(target: [`HTMLInputElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement)`|`[`HTMLTextAreaElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement)): `boolean`<br/>
|
||||
Checks if the target element can have its text copied.
|
||||
- _target:_ [`HTMLInputElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLInputElement)`|`[`HTMLTextAreaElement`](https://developer.mozilla.org/en-US/docs/Web/API/HTMLTextAreaElement) - Target HTML element
|
||||
- **Returns** `boolean` - True if the text can be copied, false otherwise
|
||||
|
||||
## 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.
|
||||
|
||||
## See also
|
||||
|
||||
- [Clipboard directive](../../core/directives/clipboard.directive.md)
|
Reference in New Issue
Block a user