AngularJS module to copy HTML tags on click, and send custom values to clipboard. No need for any Flash complements. It works on mobile devices.
##Installation
-
Download the latest release from here.
-
Include ngClipboard.js in your HTML.
<script src="ngClipboard.js"></script>
-
Inject the module in your app.
angular.module('myApp',['ngClipboard']);
##Demo http://plnkr.co/edit/TMGDUH5IG4GazpBvT2rQ
##Usage
###ng-copyable
directive
Add a "ng-copyable" attribute to any html tag to make it copyable on click.
<div ng-copyable>Click to copy this text!</div>
###ngClipboard.toClipboard()
factory
-
Inject ngClipboard in your controller
angular.controller('myController',['ngClipboard',function(ngClipboard){ /* ... */ }]);
-
Then send values to clipboard using
ngClipboard.toClipboard(value);