Ninja Pumpkin Mutants

    ngx-copypaste
    TypeScript icon, indicating that this package has built-in type declarations

    10.0.0 • Public • Published

    ngx-copypaste

    npm npm downloads npm GitHub contributors GitHub stars
    You can also try our NGX MASK Download it. You can also try our NGX LOADER INDICATOR Download it.

    You can see the full documentation with examples.

    Installing

    $ npm install --save ngx-copypaste 

    Quickstart

    Import ngx-copypaste module in Angular app.

    import {NgxCopyPasteModule} from 'ngx-copypaste'
     
    (...)
     
    @NgModule({
      (...)
      imports: [
        NgxCopyPasteModule
      ]
      (...)
    })

    Usage

    From input

    <input type='text' ngxCopyPaste #cp="copy"/>
     
    <button (click)="cp.copy()">Copy</button>

    From any HTML tag

    <p ngxCopyPaste #cp="copy">Lorem ipsum</p>
     
    <button (click)="cp.copy()">Copy</button>

    From complex div

    <div ngxCopyPaste #cp="copy">
      <h1>Lorem ipsum</h1>
      <p>Lorem ipsum dolor sit amet, consectetur 
      adipiscing elit.
     Nullam rutrum augue at ante sollicitudin posuere.
     Pellentesque congue consequat enim quis luctus.</p>
      <div>
        <h2>Lorem ipsum</h2>
      </div>
    </div>
     
    <button (click)="cp.copy()">Copy</button>

    Also you can bind it to any tag

    <p ngxCopyPaste #cp="copy">Lorem ipsum</p>
     
    <p (click)="cp.copy()">Copy</p>

    Install

    npm i ngx-copypaste

    DownloadsWeekly Downloads

    226

    Version

    10.0.0

    License

    MIT

    Unpacked Size

    23.4 kB

    Total Files

    17

    Last publish

    Collaborators

    • igornepipenko