Skip to content

Commit 5149dc6

Browse files
author
Stan Bondi
committed
Updated README.md
1 parent 23f3824 commit 5149dc6

File tree

1 file changed

+21
-32
lines changed

1 file changed

+21
-32
lines changed

README.md

Lines changed: 21 additions & 32 deletions
Original file line numberDiff line numberDiff line change
@@ -23,48 +23,37 @@ angular.module('demo', ['angular.zeroclipboard']).
2323
moviePath: '../bower_components/zeroclipboard/ZeroClipboard.swf'
2424
});
2525

26-
// set directive options
27-
uiZeroclipConfigProvider.setOptions({
28-
buttonText: 'Copy Me!'
29-
});
30-
3126
}]);
3227
```
3328

3429

3530
## Config
3631

37-
* `uiZeroclipConfigProvider.setZcConf({})` Config the ZeroClipboard
32+
Configuration passed into `ZeroClipboard.config`
33+
34+
* `uiZeroclipConfigProvider.setZcConf({
35+
moviePath: '../path/to/ZeroClipboard.swf'
36+
* })`
3837

3938
The params is an object. and just same as [ZeroClipboard official config](https://github.com/zeroclipboard/zeroclipboard/blob/1.x-master/docs/instructions.md)
4039

41-
* `uiZeroclipConfigProvider.setOptions()` Config this directive Config
40+
## Usage
4241

43-
```js
44-
{
45-
// set the button class
46-
buttonClass: '',
47-
48-
// set button's Text
49-
buttonText: 'Copy',
50-
51-
// set `true`, then when trigger an event by clipboard, it will emit an angular event by .$emit()
52-
// then you can listen the angular type event in your controller.
53-
// the event which be emited will bt like: 'ZeroClipboard.[eventType]', for example: 'ZeroClipboard.complete'
54-
// ATTENTION: if you set this to true, the callback functions you set below will be ignored.
55-
emitEvent: true,
56-
57-
// set the callback function of the events which ZeroClipboard dispataches
58-
load: null,
59-
mouseover: null,
60-
mouseout: null,
61-
mousedown: null,
62-
mouseup: null,
63-
complete: null,
64-
noflash: null,
65-
wrongflash: null,
66-
dataRequested: null
67-
}
42+
Example using a two-way model binding
43+
44+
```html
45+
<input type="text" ng-model="myText" />
46+
<button ui-zeroclip zeroclip-copied="copied=true" zeroclip-model="myText">Copy</button>
47+
<span ng-show="copied">Text Copied!</span>
48+
```
49+
50+
Example using interpolated text:
51+
52+
```html
53+
<input type="text" ng-model="myText" />
54+
<button ui-zeroclip zeroclip-copied="copied=true"
55+
zeroclip-text="This was your text: {{ myText }}">Copy</button>
56+
<span ng-show="copied">The sentence "This was your text: {{ myText }}" was copied!</span>
6857
```
6958

7059
## LICENSE

0 commit comments

Comments
 (0)