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: 3 months 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 (about 6 years ago)
- Default Branch: develop
- Last Pushed: 2024-07-08T13:20:22.000Z (10 months ago)
- Last Synced: 2024-10-06T02:08:05.333Z (7 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[](https://github.com/JsDaddy/ngx-copypaste/actions/workflows/main.yml)
[](https://www.npmjs.com/package/ngx-copypaste)
[](https://npmjs.org/ngx-copypaste)[](https://www.npmjs.com/package/ngx-copypaste)
[](https://github.com/JSDaddy/ngx-copypaste)
[](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 }
```