Copy to Clipboard Directive

November 14, 2015

Yesterday I was requested to create a “copy to clipboard” behavior in an AngularJS application I’m building. The main idea was to mark some content which has a meaning and to enable the user to copy the “meaning” to the clipboard by pressing a button. Here is the directive I ended up with: (function () { 'use strict'; angular. module("demo"). directive("copyToClipboard", copyClipboardDirective);  function copyClipboardDirective() { var clip;  ...
no comments