🚀 Big News: Socket Acquires Coana to Bring Reachability Analysis to Every Appsec Team.Learn more
Socket
Sign inDemoInstall
Socket

angular-copy-to-clipboard

Package Overview
Dependencies
Maintainers
1
Versions
19
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

angular-copy-to-clipboard

Angular Copy To Clipboard (Directive/Component/Content projection)

0.0.19
latest
Source
npm
Version published
Weekly downloads
15
7.14%
Maintainers
1
Weekly downloads
 
Created
Source

AngularCopyToClipboard

Angular Copy To Clipboard (Directive/Component/Content projection)

copyToClipboard

Demo

stackblitz

Copy to clipboard by three ways:

  • Directive
  • Component(Has icon with icon color and icon size)
  • Content projection

Table of contents

Install

npm i angular-copy-to-clipboard

Quick start

import { AngularCopyToClipboardModule } from "angular-copy-to-clipboard";

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

How to use?

  • As Component

<angular-copy-to-clipboard
  [height]="1.5"
  [width]="1.5"
  [color]="'#3456cc'"
  [targetId]="'copy-me'"
  (error)="error()"
  (success)="success()"
></angular-copy-to-clipboard>
  • As Directive

You can use it in each HTML tag that you need

<button
  copyToClipboard
  [targetId]="'copy-me'"
  (error)="error()"
  (success)="success()"
>
  Please copy me
</button>
  • As Content projection

<angular-copy-to-clipboard [targetId]="'copy-me'" (error)="error()" (success)="success()">
  My component or html element
</angular-copy-to-clipboard>

Define functions

  public error(): void {
    /** */
  }
  public success(): void {
    /** */
  }

Input

NameTypeDefaultRequired?Description
targetIdstring numberyesThe Element Id of content that you want to copy.
widthnumber1.3remnoIcon width when use as component.
heightnumber1.3remnoIcon height when use as component.
colorstringgraynoIcon color when use as component.

Output

NameDescription
(error)Define message for error.
(success)Define message for success.

Creator

Hakime sheikhalishahi

Donate

If you like my work and I save your time you can buy me a 🍺 or 🍕

My Wallet address , Tether USD (ARBITRUM) : 0x04e125a00BCd45A4DD23279DcAfF1eAFd49DbEf6

License

MIT

Keywords

angular

FAQs

Package last updated on 21 Jun 2022

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