Ember Zero Clipboard
This is an Ember CLI addon for adding a Zero Clipboard component.
Installation
$ npm install --save-dev ember-cli-zero-clipboard
Usage
In your handlebars template just do:
{{zero-clipboard text=TEXT label=LABEL}}
or
{{zero-clipboard cbTarget=TARGET_ELEMENT_ID label=LABEL}}
- TEXT: String, to be copied when button is clicked.
- TARGET_ELEMENT_ID: String, value or html contents to be copied.
- LABEL: String, the value of the button.
Example
{{zero-clipboard text=repoPath label="Copy" innerClass="btn btn-default"}}
will output:
Copy
Extending
You can subclass this module if you want to add specific behaviours:
// file: your-app/components/zero-clipboard.js ; ;
You can also pass a closure action, without subclassing the component.
{{zero-clipboard afterCopy=(action "alertAfterCopy")}}
Pass a block if you want to customize the html:
{{#zero-clipboard text='Hello'}}<p>COPY ME!</p>{{/zero-clipboard}}