Huge News!Announcing our $40M Series B led by Abstract Ventures.Learn More
Socket
Sign inDemoInstall
Socket

@ngnz/copy-to-clipboard

Package Overview
Dependencies
Maintainers
1
Versions
6
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

@ngnz/copy-to-clipboard

>Simple Angular module exposing basic Directive that'll try to use native `document.execCommand` to copy content text to clopboard and finally, display overidable `alert` to confirme action to user.

  • 0.0.2
  • npm
  • Socket score

Version published
Weekly downloads
1
decreased by-50%
Maintainers
1
Weekly downloads
 
Created
Source

✂️ copy-to-clipboard

Simple Angular module exposing basic Directive that'll try to use native document.execCommand to copy content text to clopboard and finally, display overidable alert to confirme action to user.

installation

Install npm package with the following commande:

$ npm install @ngzn/copy-to-clipboard

And add import inside app.module.ts or desired module.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule } from '@angular/core';

import { AppComponent } from './app.component';
// import Angualr CopyToClipboardModule from @ngnz
import { CopyToClipboardModule } from '@ngnz/copy-to-clipboard';

@NgModule({
  declarations: [AppComponent],
  imports: [
    BrowserModule,
    // add module inside your Angular application module
    CopyToClipboardModule 
  ],
  providers: [],
  bootstrap: [AppComponent],
})
export class AppModule {}

Usage

When an element that contains nzCopyToClipboard directive is clicked, the value of nzCopyToClipboard will be copied into the clipboard.

<button nzCopyToClipboard="Text to copy to clipboard">Copy</button>
<button [nzCopyToClipboard]="typescritpProperty">Copy</button>

Only Function Usage

This feature is exporetable without Angular wrapping to allow using inside other projet.

// import function
import { copyToClipboardFunction } from '@ngnz/copy-to-clipboard';

// user copy function logic
const myTextToCopy = 'See magic happen!';
copyToClipboardFunction(myTextToCopy);

FAQs

Package last updated on 22 Jan 2021

Did you know?

Socket

Socket for GitHub automatically highlights issues in each pull request and monitors the health of all your open source dependencies. Discover the contents of your packages and block harmful activity before you install or update your dependencies.

Install

Related posts

SocketSocket SOC 2 Logo

Product

  • Package Alerts
  • Integrations
  • Docs
  • Pricing
  • FAQ
  • Roadmap
  • Changelog

Packages

npm

Stay in touch

Get open source security insights delivered straight into your inbox.


  • Terms
  • Privacy
  • Security

Made with ⚡️ by Socket Inc