Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/JsDaddy/ngx-copypaste
A pure and awesome copy paste directive for Angular
https://github.com/JsDaddy/ngx-copypaste
angular angular-clipboard angular-copypaste clipboard copypaste ngx ngx-clipboard ngx-copypaste typescript
Last synced: 12 days ago
JSON representation
A pure and awesome copy paste directive for Angular
- Host: GitHub
- URL: https://github.com/JsDaddy/ngx-copypaste
- Owner: JsDaddy
- License: mit
- Created: 2019-04-01T10:21:19.000Z (almost 6 years ago)
- Default Branch: develop
- Last Pushed: 2024-07-08T13:20:22.000Z (7 months ago)
- Last Synced: 2024-10-06T02:08:05.333Z (4 months ago)
- Topics: angular, angular-clipboard, angular-copypaste, clipboard, copypaste, ngx, ngx-clipboard, ngx-copypaste, typescript
- Language: TypeScript
- Homepage: https://jsdaddy.github.io/ngx-copypaste/
- Size: 9.16 MB
- Stars: 26
- Watchers: 4
- Forks: 2
- Open Issues: 4
-
Metadata Files:
- Readme: README.md
- Changelog: CHANGELOG.md
- Contributing: CONTRIBUTING.md
- License: LICENSE
Awesome Lists containing this project
- awesome-angular - ngx-copypaste - A pure and awesome copy paste directive for Angular. (Table of contents / Third Party Components)
- fucking-awesome-angular - ngx-copypaste - A pure and awesome copy paste directive for Angular. (Table of contents / Third Party Components)
README
NGX COPYPASTE is the best directive to copy any content on any element[![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
```bash
$ npm 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
Copy
```From any HTML tag
```html
Lorem ipsum
Copy
```From complex div
```html
Lorem ipsum
Lorem ipsum dolor sit amet, consectetur adipiscing elit. Nullam rutrum augue at ante
sollicitudin posuere. Pellentesque congue consequat enim quis luctus.
Lorem ipsum
Copy
```Also you can bind it to any tag
```html
Lorem ipsum
Copy
```Output success cb
```html
Lorem ipsum
Copy
public copy(): void { your code }
```