Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

ngclipboard

Package Overview
Dependencies
Maintainers
1
Versions
5
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngclipboard - npm Package Compare versions

Comparing version 1.0.0 to 1.1.0

test/test.js

4

bower.json
{
"name": "ngclipboard",
"version": "1.0.0",
"version": "1.1.0",
"homepage": "https://github.com/sachinchoolur/ngclipboard",

@@ -18,3 +18,3 @@ "authors": [

"dependencies": {
"clipboard": "^1.0.0",
"clipboard": "~1.5.5",
"angular": ">=1.2.0"

@@ -21,0 +21,0 @@ },

@@ -1,2 +0,2 @@

/*! ngclipboard - v1.0.0 - 2015-10-21
/*! ngclipboard - v1.1.0 - 2015-12-30
* https://github.com/sachinchoolur/ngclipboard

@@ -6,3 +6,15 @@ * Copyright (c) 2015 Sachin; Licensed MIT */

'use strict';
angular.module('ngclipboard', []).directive('ngclipboard', function() {
var MODULE_NAME = 'ngclipboard';
var angular, Clipboard;
if (typeof module !== 'undefined' && typeof module.exports === 'object') {
angular = require('angular');
Clipboard = require('clipboard');
module.exports = MODULE_NAME;
} else {
angular = window.angular;
Clipboard = window.Clipboard;
}
angular.module(MODULE_NAME, []).directive('ngclipboard', function() {
return {

@@ -15,15 +27,7 @@ restrict: 'A',

link: function(scope, element) {
var clipboard = new Clipboard(element[0]);
var _id = element.attr('id');
if (!_id) {
element.attr('id', 'ngclipboard' + Date.now());
_id = element.attr('id');
}
var clipboard = new Clipboard('#' + _id);
clipboard.on('success', function(e) {
scope.ngclipboardSuccess({
e: e,
id: element.attr('id')
e: e
});

@@ -34,4 +38,3 @@ });

scope.ngclipboardError({
e: e,
id: element.attr('id')
e: e
});

@@ -38,0 +41,0 @@ });

@@ -1,4 +0,4 @@

/*! ngclipboard - v1.0.0 - 2015-10-21
/*! ngclipboard - v1.1.0 - 2015-12-30
* https://github.com/sachinchoolur/ngclipboard
* Copyright (c) 2015 Sachin; Licensed MIT */
!function(){"use strict";angular.module("ngclipboard",[]).directive("ngclipboard",function(){return{restrict:"A",scope:{ngclipboardSuccess:"&",ngclipboardError:"&"},link:function(a,b){var c=b.attr("id");c||(b.attr("id","ngclipboard"+Date.now()),c=b.attr("id"));var d=new Clipboard("#"+c);d.on("success",function(c){a.ngclipboardSuccess({e:c,id:b.attr("id")})}),d.on("error",function(c){a.ngclipboardError({e:c,id:b.attr("id")})})}}})}();
!function(){"use strict";var a,b,c="ngclipboard";"undefined"!=typeof module&&"object"==typeof module.exports?(a=require("angular"),b=require("clipboard"),module.exports=c):(a=window.angular,b=window.Clipboard),a.module(c,[]).directive("ngclipboard",function(){return{restrict:"A",scope:{ngclipboardSuccess:"&",ngclipboardError:"&"},link:function(a,c){var d=new b(c[0]);d.on("success",function(b){a.ngclipboardSuccess({e:b})}),d.on("error",function(b){a.ngclipboardError({e:b})})}}})}();
{
"name": "ngclipboard",
"version": "1.0.0",
"version": "1.1.0",
"description": "Angularjs directive for clipboard.js",

@@ -31,2 +31,6 @@ "keywords": [

},
"dependencies": {
"clipboard": "~1.5.5",
"angular": ">=1.2.0"
},
"devDependencies": {

@@ -33,0 +37,0 @@ "grunt": "^0.4.5",

@@ -1,3 +0,1 @@

# ngclipboard
![license](https://img.shields.io/npm/l/ngclipboard.svg)

@@ -8,2 +6,5 @@ ![travis](https://travis-ci.org/sachinchoolur/ngclipboard.svg?branch=master)

# ngclipboard
##### An angularjs directive to copy text to clipboard without using flash
> Angularjs directive for [clipboard.js](http://zenorocha.github.io/clipboard.js/) by [@zenorocha](https://twitter.com/zenorocha)

@@ -10,0 +11,0 @@

(function() {
'use strict';
angular.module('ngclipboard', []).directive('ngclipboard', function() {
var MODULE_NAME = 'ngclipboard';
var angular, Clipboard;
if (typeof module !== 'undefined' && typeof module.exports === 'object') {
angular = require('angular');
Clipboard = require('clipboard');
module.exports = MODULE_NAME;
} else {
angular = window.angular;
Clipboard = window.Clipboard;
}
angular.module(MODULE_NAME, []).directive('ngclipboard', function() {
return {

@@ -11,15 +23,7 @@ restrict: 'A',

link: function(scope, element) {
var clipboard = new Clipboard(element[0]);
var _id = element.attr('id');
if (!_id) {
element.attr('id', 'ngclipboard' + Date.now());
_id = element.attr('id');
}
var clipboard = new Clipboard('#' + _id);
clipboard.on('success', function(e) {
scope.ngclipboardSuccess({
e: e,
id: element.attr('id')
e: e
});

@@ -30,4 +34,3 @@ });

scope.ngclipboardError({
e: e,
id: element.attr('id')
e: e
});

@@ -34,0 +37,0 @@ });

Sorry, the diff of this file is not supported yet

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc