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.6
  • latest
  • npm
  • Socket score

Version published
Maintainers
1
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 27 Mar 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