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