copy to clipboard

This commit is contained in:
Sebastiaan Pasma 2018-06-28 14:16:33 +02:00
commit 243f35c25d
3 changed files with 9 additions and 8 deletions

View file

@ -1,7 +1,7 @@
'use strict';
angular.module('copayApp.directives')
.directive('copyToClipboard', function(clipboardService) {
.directive('copyToClipboard', function(clipboardService, ionicToast, gettextCatalog) {
return {
restrict: 'A',
scope: {
@ -14,8 +14,13 @@ angular.module('copayApp.directives')
elem.bind('click', function() {
var data = scope.copyToClipboard;
clipboardService.copyToClipboard(data);
var msg = gettextCatalog.getString('Copied to clipboard');
scope.$apply(function () {
ionicToast.show(msg, 'bottom', false, 1000);
});
clipboardService.copyToClipboard(data, scope);
});
}
}