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

ngx-clipboard

Package Overview
Dependencies
Maintainers
1
Versions
167
Alerts
File Explorer

Advanced tools

Socket logo

Install Socket

Detect and block malicious and high-risk dependencies

Install

ngx-clipboard

angular 2 clipboard

  • 5.1.0-beta.0
  • Source
  • npm
  • Socket score

Version published
Weekly downloads
154K
increased by7.88%
Maintainers
1
Weekly downloads
 
Created

What is ngx-clipboard?

ngx-clipboard is an Angular library that provides a simple way to copy text to the clipboard. It is designed to be easy to use and integrate into Angular applications, offering both directive and service-based approaches for copying text.

What are ngx-clipboard's main functionalities?

Directive-based Copy

This feature allows you to use a directive to copy text to the clipboard. By adding the `ngxClipboard` directive to a button and binding the `cbContent` property to the text you want to copy, you can easily enable copy functionality.

<button ngxClipboard [cbContent]="'Text to copy'">Copy Text</button>

Service-based Copy

This feature allows you to use a service to copy text to the clipboard. By injecting the `ClipboardService` into your component, you can call the `copy` method with the text you want to copy.

import { ClipboardService } from 'ngx-clipboard';

constructor(private clipboardService: ClipboardService) {}

copyText() {
  this.clipboardService.copy('Text to copy');
}

Copy from Input Element

This feature allows you to copy text from an input element. By referencing the input element and using the `copyFromInputElement` method of the `ClipboardService`, you can copy the text contained in the input element.

<input #inputText type="text" value="Text to copy">
<button (click)="clipboardService.copyFromInputElement(inputText)">Copy Text</button>

Other packages similar to ngx-clipboard

Keywords

FAQs

Package last updated on 29 Mar 2017

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