# ngx-copypaste

Latest version **20.0.0** (published 2025-08-05) · MIT license · 0 weekly downloads

> **Deprecated.** This package is deprecated.

## Install

```sh
npm install ngx-copypaste
pnpm add ngx-copypaste
yarn add ngx-copypaste
bun add ngx-copypaste
```

## Health

**Score 10/100 (F)** — status: deprecated.

Negative: deprecated.

## Facts

| | |
|---|---|
| Version | 20.0.0 |
| Published | 2025-08-05 |
| First published | 2019-04-01 |
| Weekly downloads | 0 |
| License | MIT |
| TypeScript types | bundled |
| Module format | ESM + CommonJS |
| Dependencies | 1 |
| Unpacked size | 12.2 KB |
| Known vulnerabilities | 0 |
| Install scripts | no |
| GitHub stars | 30 |
| Author | ngx-copypaste |
| Maintainers | igornepipenko |
| Keywords | ng2-copypaste, ngx-copypaste, ng2, ng, angular-copypaste, copypaste, angular, angular2, angular2-clipboard, ng2clipboard, jsdaddy, angular-clipboard, clipboard, angular2-clipboard, ng2clipboard, ng2-clipboard, ngx-clipboard |

## Links

- npm: https://www.npmjs.com/package/ngx-copypaste
- Repository: git@github.com:JsDaddy/ngx-copypaste
- Homepage: https://github.com/JsDaddy/ngx-copypaste
- Issues: https://github.com/JsDaddy/ngx-copypaste/issues
- npm.io page: https://npm.io/package/ngx-copypaste

## Dependencies (1)

- [tslib](https://npm.io/package/tslib.md) ^2.3.0

## Alternatives

- [angular-pipes](https://npm.io/package/angular-pipes.md) — 5.6K weekly downloads
- [@ng-web-apis/midi](https://npm.io/package/@ng-web-apis/midi.md) — 2.6K weekly downloads
- [happn-3](https://npm.io/package/happn-3.md) — 1.6K weekly downloads
- [@opensip-cli/lang-go](https://npm.io/package/@opensip-cli/lang-go.md) — 1.2K weekly downloads
- [mongoose-typescript](https://npm.io/package/mongoose-typescript.md) — 85 weekly downloads

## Recent versions

- 20.0.0 (latest) — 2025-08-05
- 19.0.1 — 2025-05-05
- 19.0.0 — 2024-11-22
- 18.0.2 — 2024-10-25
- 18.0.1 — 2024-05-30
- 18.0.0 — 2024-05-27
- 17.3.2 — 2024-03-29
- 17.0.0 — 2023-11-28
- 16.0.1 — 2023-09-28
- 16.0.0 — 2023-07-07
- 15.0.2 — 2022-12-26
- 15.0.1 — 2022-12-26
- 15.0.0 — 2022-12-25
- 10.0.0 — 2020-10-22
- 8.0.0 — 2019-08-03
- … 4 more at https://npm.io/package/ngx-copypaste/versions

## README

<a href="http://jsdaddy.io/img/logo.png">
  <h1 align="center">NGX COPYPASTE</h1>
</a>

<p align="center">
  NGX COPYPASTE is the best directive to copy any content on any element
</p>

[![CI](https://github.com/JsDaddy/ngx-copypaste/actions/workflows/quality-check.yml/badge.svg?branch=develop)](https://github.com/JsDaddy/ngx-copypaste/actions/workflows/main.yml)
[![npm](https://img.shields.io/npm/v/ngx-copypaste.svg)](https://www.npmjs.com/package/ngx-copypaste)
[![npm downloads](https://img.shields.io/npm/dt/ngx-copypaste.svg)](https://npmjs.org/ngx-copypaste)

[![npm](https://img.shields.io/npm/dm/ngx-copypaste.svg)](https://www.npmjs.com/package/ngx-copypaste)

[![GitHub contributors](https://img.shields.io/github/contributors/JSDaddy/ngx-copypaste.svg?style=flat)](https://github.com/JSDaddy/ngx-copypaste)

[![GitHub stars](https://img.shields.io/github/stars/JSDaddy/ngx-copypaste.svg?label=GitHub%20Stars&style=flat)](https://github.com/JSDaddy/ngx-copypaste)

You can also try our NGX MASK [check](https://www.npmjs.com/package/ngx-mask) it.
You can also try our NGX LOADER INDICATOR [check](https://www.npmjs.com/package/ngx-loader-indicator) it.

### You can try live [demo](https://jsdaddy.github.io/ngx-copypaste/) with examples.

## Installing

## npm

```bash
$ npm install --save ngx-copypaste
```

## bun

```bash
$ bun install --save ngx-copypaste
```

## Quickstart if ngx-copypaste version >= 15.0.0

Pay attention this version works for angular >= 14.0.0

Import **ngx-copypaste** directive to your standalone component

```typescript
@Component({
  selector: 'ngx-component',
  templateUrl: './app.component.html',
  styleUrls: ['./app.component.scss'],
  standalone: true,
  imports: [
    (...)
    NgxCopyPasteDirective,
    (...)
  ],
})
export class AppComponent {
    (...)
}
```

## Quickstart if ngx-copypaste version < 15.0.0

Pay attention this version works for angular < 15.0.0

Import **ngx-copypaste** module in Angular app.

```typescript
import {NgxCopyPasteModule} from 'ngx-copypaste'

(...)

@NgModule({
  (...)
  imports: [
    NgxCopyPasteModule
  ]
  (...)
})
```

#### Usage

From input

```html
<input type="text" ngxCopyPaste #cp="copy" />

<button (click)="cp.copy()">Copy</button>
```

From any HTML tag

```html
<p ngxCopyPaste #cp="copy">Lorem ipsum</p>

<button (click)="cp.copy()">Copy</button>
```

From complex div

```html
<div ngxCopyPaste #cp="copy">
    <h1>Lorem ipsum</h1>
    <p>
        Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam rutrum augue at ante
        sollicitudin posuere. Pellentesque congue consequat enim quis luctus.
    </p>
    <div>
        <h2>Lorem ipsum</h2>
    </div>
</div>

<button (click)="cp.copy()">Copy</button>
```

Also you can bind it to any tag

```html
<p ngxCopyPaste #cp="copy">Lorem ipsum</p>

<p (click)="cp.copy()">Copy</p>
```

Output success cb

```html
<p ngxCopyPaste #cp="copy" (successCb)="copy()">Lorem ipsum</p>

<p (click)="cp.copy()">Copy</p>

public copy(): void { your code }
```

---
_Source: https://npm.io/package/ngx-copypaste · Machine-readable twin of the npm.io package page. Health data is recomputed on every publish._
