title: ZeroClipboard + angular, multiple instances
body: <pre><code>app.directive('copyPost', ['$window', '$filter', 'ZeroClipboardPath', function ($window, $filter, ZeroClipboardPath) {
      return {
        scope: {
          postFn: '&amp;',
          postSuccess: '&amp;',
        },
        restrict: 'A',
        terminal: true,
        prioriry: 10,
        link: function (scope, element, attrs) {
          scope.disaplyValue = 'Copy';
          ZeroClipboardPath = 'lib/zeroclipboard/ZeroClipboard.swf';
          var clip = new ZeroClipboard( $(element), {
            moviePath: ZeroClipboardPath    
          });
          clip.on('dataRequested', function(client, args) {
            scope.postFn().then(function(data){
              client.setText(data.data[0].external_url);
              scope.postSuccess();
            });  
  
          });
        }
      }
    }]);
  </code></pre>
  
  <p>Creating multiple instances of this directive makes the swf object to trigger the event only for the first instance over the the entire application(same link copied).</p>
  
  <p>obviously I have more than one link that I would like to allow my user to copy in my application.</p>
  
  <p>Any help is much appreciated</p>