Gathering detailed insights and metrics for ngx-copy-to-clipboard
Gathering detailed insights and metrics for ngx-copy-to-clipboard
Gathering detailed insights and metrics for ngx-copy-to-clipboard
Gathering detailed insights and metrics for ngx-copy-to-clipboard
@andreasnicolaou/ngx-copy-to-clipboard
A lightweight, standalone Angular directive for copying text to the clipboard using the Clipboard API.
angular-copy-to-clipboard
Angular Copy To Clipboard (Directive/Component/Content projection)
@irshadali/ngx-copy-to-clipboard
Click and copy to your clipboard fast
ngx-simpler-copy
Just for copy text to clipboard, only that !!!
Copy content to clipboard in Angular applications easier 🎯.
npm install ngx-copy-to-clipboard
Typescript
Module System
Node Version
NPM Version
TypeScript (66.93%)
JavaScript (19.69%)
HTML (12.94%)
SCSS (0.44%)
Total Downloads
0
Last Day
0
Last Week
0
Last Month
0
Last Year
0
9 Stars
63 Commits
3 Forks
1 Watchers
30 Branches
2 Contributors
Updated on Oct 09, 2021
Latest Version
2.3.0
Package Id
ngx-copy-to-clipboard@2.3.0
Unpacked Size
58.22 kB
Size
14.55 kB
File Count
20
NPM Version
6.13.4
Node Version
12.14.1
Cumulative downloads
Total Downloads
Last Day
0%
NaN
Compared to previous day
Last Week
0%
NaN
Compared to previous week
Last Month
0%
NaN
Compared to previous month
Last Year
0%
NaN
Compared to previous year
2
Your module to copy content to clipboard in Angular applications easier 🎯.
This is a common concept, but why use this directive instead solve it via server-side rendering?
The idea of this directive is make this process transparent and easier. So the main point is integrate this directive with other tooling process, such as:
You can integrate with WebSockets or handling this in a EventSourcing architecture. It's totally transparent for you and you can integrate easier in your application.
Try out our demo on Stackblitz!
You can get it on NPM installing ngx-copy-to-clipboard
module as a project dependency.
1npm install ngx-copy-to-clipboard --save
You'll need to add NgxCopyToClipboardModule
to your application module. So that, the <ngx-copy-to-clipboard>
components will be accessible in your application.
1... 2import { NgxCopyToClipboardModule } from 'ngx-copy-to-clipboard'; 3... 4@NgModule({ 5 declarations: [ 6 YourAppComponent 7 ], 8 imports: [ 9 ... 10 NgxCopyToClipboardModule, 11 ... 12 ], 13 providers: [], 14 bootstrap: [YourAppComponent] 15}) 16 17export class YourAppComponent {} 18
Now you just need to add a configuration in your components and, after that, you can use the ngx-copy-to-clipboard
component in your templates, passing the required attributes to make it work properly.
1import { Component } from '@angular/core'; 2 3@Component({ 4 selector: 'component-docs', 5 template: ` 6 <section class="section"> 7 <h2>Copying data from textarea element</h2> 8 <textarea name="text-content" id="text-content" rows="5" cols="33"> 9Demonstration content... 10 </textarea 11 > 12 <ngx-copy-to-clipboard 13 target="#text-content" 14 [action]="cut" 15 [success]="onSuccess" 16 [error]="onError" 17 >Copy</ngx-copy-to-clipboard 18 > 19 </section> 20 `, 21}) 22export class ComponentDocsComponent { 23 copiedText = ''; 24 25 constructor() { 26 this.onSuccess = this.onSuccess.bind(this); 27 this.onError = this.onError.bind(this); 28 } 29 30 onSuccess(e) { 31 this.copiedText = e.text; 32 } 33 34 onError(e) { 35 this.copiedText = 'Error trying to copy your text'; 36 } 37}
You should bind the
success
anderror
function callbacks before passing through the component to make sure your component will be running based on the same scope.
npm start
and access the link http://localhost:4200
in your browsernpm test
for run tests. In case you want to test using watch, please use npm run tdd
this project is using np
package to publish, which makes things straightforward. EX: np <patch|minor|major> --contents=dist/ngx-copy-to-clipboard
For more details, please check np package on npmjs.com
For any type of contribution, please follow the instructions in CONTRIBUTING.md and read CODE_OF_CONDUCT.md files.
Wilson Mendes (willmendesneto)
No vulnerabilities found.
Reason
no binaries found in the repo
Reason
Found 6/20 approved changesets -- score normalized to 3
Reason
0 commit(s) and 0 issue activity found in the last 90 days -- score normalized to 0
Reason
no effort to earn an OpenSSF best practices badge detected
Reason
security policy file not detected
Details
Reason
project is not fuzzed
Details
Reason
license file not detected
Details
Reason
branch protection not enabled on development/release branches
Details
Reason
SAST tool is not run on all commits -- score normalized to 0
Details
Reason
118 existing vulnerabilities detected
Details
Score
Last Scanned on 2025-06-30
The Open Source Security Foundation is a cross-industry collaboration to improve the security of open source software (OSS). The Scorecard provides security health metrics for open source projects.
Learn More