'use strict';

angular.module('ngClipboard', []).
  value('ZeroClipboardPath', '//cdnjs.cloudflare.com/ajax/libs/zeroclipboard/1.1.7/ZeroClipboard.swf').
  directive('clipCopy', ['$window', 'ZeroClipboardPath', function ($window, ZeroClipboardPath) {
    return {
      scope: {
        clipCopy: '&',
        clipClick: '&'
      },
      restrict: 'A',
      link: function (scope, element, attrs) {
        // Create the clip object
        var clip = new ZeroClipboard( element, {
          moviePath: ZeroClipboardPath,
          trustedDomains: ['*'],
          allowScriptAccess: "always"          
        });

        clip.on( 'mousedown', function(client) {
          client.setText(scope.$eval(scope.clipCopy));
          if (angular.isDefined(attrs.clipClick)) {
            scope.$apply(scope.clipClick);
          }
        });
      }
    }
  }]);

@@ -65,22 +65,36 @@
 lipboard
-Path',
+Config', %7B%0A    path:
  '//cdnj
@@ -158,16 +158,20 @@
 ard.swf'
+%0A  %7D
 ).%0A  dir
@@ -215,20 +215,22 @@
 lipboard
-Path
+Config
 ', funct
@@ -256,20 +256,22 @@
 lipboard
-Path
+Config
 ) %7B%0A    
@@ -534,17 +534,24 @@
 lipboard
-P
+Config.p
 ath,%0A   

Allow script access always