Skip to content

Simple module that allows to make an HTML tag copyable on click or send a custom string to clipboard. Works on mobile!

Notifications You must be signed in to change notification settings

mi60dev/ngClipboard

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 

Repository files navigation

ngClipboard

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

  1. Download the latest release from here.

  2. Include ngClipboard.js in your HTML.

    <script src="ngClipboard.js"></script>
  3. 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

  1. Inject ngClipboard in your controller

    angular.controller('myController',['ngClipboard',function(ngClipboard){
      /* ... */
    }]);
  2. Then send values to clipboard using

ngClipboard.toClipboard(value);

About

Simple module that allows to make an HTML tag copyable on click or send a custom string to clipboard. Works on mobile!

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 100.0%