}
return {
- copyText: copyText,
- supported: 'queryCommandSupported' in document && document.queryCommandSupported('copy')
+ copyText: copyText
};
}])
.directive('clipboard', ['clipboard', function (clipboard) {
scope: {
onCopied: '&',
onError: '&',
- text: '=',
- supported: '=?'
+ text: '='
},
link: function (scope, element) {
- scope.supported = clipboard.supported;
-
element.on('click', function (event) {
try {
clipboard.copyText(scope.text);
};
}]);
-}));
+}));
\ No newline at end of file