JSPM

  • ESM via JSPM
  • ES Module Entrypoint
  • Export Map
  • Keywords
  • License
  • Repository URL
  • TypeScript Types
  • README
  • Created
  • Published
  • Downloads 12
  • Score
    100M100P100Q58372F
  • License MIT

Copy to clipboard

Package Exports

  • @andreasnicolaou/ngx-copy-to-clipboard

This package does not declare an exports field, so the exports above have been automatically detected and optimized by JSPM instead. If any package subpath is missing, it is recommended to post an issue to the original package (@andreasnicolaou/ngx-copy-to-clipboard) to support the "exports" field. If that is not possible, create a JSPM override to customize the exports field for this package.

Readme

ngx-copy-to-clipboard

Click and copy to clipboard



npm npm npm



Installation

1. Install via NPM:

npm i --save @andreasnicolaou/ngx-copy-to-clipboard

3. Import NgxCopyToClipboardModule into your app's root module

import { NgxCopyToClipboardModule } from '@andreasnicolaou/ngx-copy-to-clipboard';

@NgModule({
  ...
  imports: [
    NgxCopyToClipboardModule
  ],
  ...
})
export class AppModule { }



Inputs Description
textToCopy String Text to copy
successMessage On copy success message
errorMessage On copy error message
onCopyEvent On copy event get success message (has default message-ovverid)
onErrorEvent On copy event get error message (has default message-ovverid)

Example

    const val = 'Hello World!';

    public onSuccess(ev: string){
        console.log(ev);
    }

     public onError(ev: string){
        console.log(ev);
    }
    <button copyToClipboard [textToCopy]="val" [successMessage]="'Copied to Clipboard'" [errorMessage]="'Not copied to Clipboard'"
     (onCopyEvent)="onSuccess($event)" (onErrorEvent)="onError($event)">Copy</button>

Contribution

  • Having an issue? or looking for support? Open an issue and we will get you the help you need.
  • Got a new feature or a bug fix? Fork the repo, make your changes, and submit a pull request.

Support this project

If you find this project useful, please star the repo to let people know that it's reliable. Also, share it with friends and colleagues that might find this useful as well. Thank you 😄