Skip to content

Commit

Permalink
Merge pull request #46 from sachinchoolur/45
Browse files Browse the repository at this point in the history
45
  • Loading branch information
sachinchoolur authored Mar 3, 2018
2 parents b8fe8f4 + f2ad9fe commit cfe6890
Show file tree
Hide file tree
Showing 5 changed files with 26 additions and 24 deletions.
6 changes: 3 additions & 3 deletions bower.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngclipboard",
"version": "1.1.3",
"version": "2.0.0",
"homepage": "https://github.com/sachinchoolur/ngclipboard",
"license": "MIT",
"authors": [
Expand All @@ -16,8 +16,8 @@
"angularjs"
],
"dependencies": {
"clipboard": "~1.5.5",
"angular": ">=1.2.0"
"clipboard": "^2.0.0",
"angular": "^1.2.0"
},
"ignore": [
"README.md",
Expand Down
17 changes: 9 additions & 8 deletions dist/ngclipboard.js
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
/*! ngclipboard - v1.1.3 - 2017-10-31
/*! ngclipboard - v2.0.0 - 2018-03-03
* https://github.com/sachinchoolur/ngclipboard
* Copyright (c) 2017 Sachin; Licensed MIT */
* Copyright (c) 2018 Sachin; Licensed MIT */
(function() {
'use strict';
var MODULE_NAME = 'ngclipboard';
var angular, Clipboard;
var angular, ClipboardJS;

// Check for CommonJS support
if (typeof module === 'object' && module.exports) {
angular = require('angular');
Clipboard = require('clipboard');
ClipboardJS = require('clipboard');
module.exports = MODULE_NAME;
} else {
angular = window.angular;
Clipboard = window.Clipboard;
ClipboardJS = window.ClipboardJS;
}

angular.module(MODULE_NAME, []).directive('ngclipboard', function() {
Expand All @@ -24,7 +24,8 @@
ngclipboardError: '&'
},
link: function(scope, element) {
var clipboard = new Clipboard(element[0]);
//constructor for clipboardjs changed to ClipboardJS
var clipboard = new ClipboardJS(element[0]);

clipboard.on('success', function(e) {
scope.$apply(function () {
Expand All @@ -41,7 +42,7 @@
});
});
});

element.on('$destroy', function() {
clipboard.destroy();
});
Expand Down
6 changes: 3 additions & 3 deletions dist/ngclipboard.min.js

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions package.json
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
{
"name": "ngclipboard",
"version": "1.1.3",
"version": "2.0.0",
"description": "Angularjs directive for clipboard.js",
"keywords": [
"ngclipboard",
Expand Down Expand Up @@ -29,13 +29,13 @@
"test": "grunt"
},
"dependencies": {
"clipboard": "~1.5.5"
"clipboard": "^2.0.0"
},
"peerDependencies": {
"angular": ">=1.2.0"
"angular": "^1.2.0"
},
"devDependencies": {
"angular": ">=1.2.0",
"angular": "^1.2.0",
"grunt": "^0.4.5",
"grunt-contrib-clean": "^0.6.0",
"grunt-contrib-concat": "^0.5.0",
Expand Down
13 changes: 7 additions & 6 deletions src/ngclipboard.js
Original file line number Diff line number Diff line change
@@ -1,16 +1,16 @@
(function() {
'use strict';
var MODULE_NAME = 'ngclipboard';
var angular, Clipboard;
var angular, ClipboardJS;

// Check for CommonJS support
if (typeof module === 'object' && module.exports) {
angular = require('angular');
Clipboard = require('clipboard');
ClipboardJS = require('clipboard');
module.exports = MODULE_NAME;
} else {
angular = window.angular;
Clipboard = window.Clipboard;
ClipboardJS = window.ClipboardJS;
}

angular.module(MODULE_NAME, []).directive('ngclipboard', function() {
Expand All @@ -21,7 +21,8 @@
ngclipboardError: '&'
},
link: function(scope, element) {
var clipboard = new Clipboard(element[0]);
//constructor for clipboardjs changed to ClipboardJS
var clipboard = new ClipboardJS(element[0]);

clipboard.on('success', function(e) {
scope.$apply(function () {
Expand All @@ -38,7 +39,7 @@
});
});
});

element.on('$destroy', function() {
clipboard.destroy();
});
Expand Down

0 comments on commit cfe6890

Please sign in to comment.