aurelia-clipboard

1.0.4 • Public • Published

aurelia-clipboard

Aurelia custom attribute for using browser's clipboard api

Getting Started

This custom attribute uses document.execCommand which is ~86% supported across all browsers. It creates an empty textarea element, sets the innerText to the text you want to copy, then removes the element.

Installation

To install, simply run npm install aurelia-clipoard.

Usage

<require from="XXX/clipboard"></require>
<span>${name}</span>
<i class="fa fa-clipboard" clipboard="${name}"></i>

In main.js, add the plugin to the exported aurelia function:

export function configure(aurelia) {
    aurelia.use
      .standardConfiguration()
      .developmentLogging()
      .plugin('aurelia-clipboard');

    ...
}

License

This project is licensed under the MIT License - see the LICENSE.md file for details

Dependencies (1)

Dev Dependencies (0)

    Package Sidebar

    Install

    npm i aurelia-clipboard

    Weekly Downloads

    5

    Version

    1.0.4

    License

    MIT

    Last publish

    Collaborators

    • devanp92