Giter Site home page Giter Site logo

hiro-hori / ngx-clipboard Goto Github PK

View Code? Open in Web Editor NEW

This project forked from maxisam/ngx-clipboard

0.0 2.0 0.0 564 KB

A wrapper directive for clipboard.js

Home Page: http://maxisam.github.io/ngx-clipboard/

License: MIT License

JavaScript 25.51% TypeScript 74.49%

ngx-clipboard's Introduction

Commitizen friendly travis build npm GitHub release npm

ngx-clipboard , F.K.A angular2-clipboard

From 6.0.0, there is no dependency anymore. Just Angular.

It works with angular version 2.0.0 and up

To make more sense with the future versioning scheme of Angular, the directive selector is now rename to ngxClipboard

Dependencies

  • Angular >=4.0.0

If you need to use it on 2.0.0, please use version 7.x.x.

The code are pretty much the same, in 8.0.0 it uses InjectionToken which requires angular4.

Install

You can get it on npm.

npm install ngx-clipboard --save

Build project

1. npm i

2. npm run build

Usage

If you use SystemJS to load your files, you might have to update your config:

System.config({
    map: {
        'ngx-clipboard': 'node_modules/ngx-clipboard'
    }
});

For webpack / Angular CLI, it works as any other libraries. Please check demo folder for more help.

This library support 2 kinds of copy source.

You can either set

[cbContent]="'target string'"

Or

[ngxClipboard]="inputTarget" 

PLEASE CHECK WITH PLUNKER FIRST

Example

plunker

Contributing

  1. Your commits conform to the conventions established here
  2. This project used commitizen and semantic-release to handle npm version from CI
    • run git add first to add your changes to staging
    • use npm run commit to commit, and CI will do the rest.
    • if changes contain breaking change, use BREAKING CHANGE keyword in the comment to trigger major release
    • before push to git and trigger CI, you can dry run npm run semantic-release locally to make sure the version number is push as expected.

Troubleshooting

  1. If you use webpack, check /demo/webpack. Try to use the same version of webpack that demo used, if you run into any error.

  2. The latest version (3.0.0+) works with AoT, please check /demo/angular2-aot-webpack to see how to make it work.

Kudos to

Thierry Templier This project is inspired by his answer on StackOverflow.

The core function is ported from clipboard.js by @zenorocha.

blacksonic AoT's demo is based on his project.

ngx-clipboard's People

Contributors

maxisam avatar jsmike avatar saulshanabrook avatar akialapiha avatar npmcdn-to-unpkg-bot avatar

Watchers

James Cloos avatar Hiro Hori avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.