https://github.com/f22hd/ng-nocopy
A directive that prevent a user from copying a specific element content.
https://github.com/f22hd/ng-nocopy
angular copy
Last synced: 2 months ago
JSON representation
A directive that prevent a user from copying a specific element content.
- Host: GitHub
- URL: https://github.com/f22hd/ng-nocopy
- Owner: f22hd
- Created: 2021-04-01T23:24:54.000Z (over 5 years ago)
- Default Branch: main
- Last Pushed: 2021-04-02T12:49:31.000Z (over 5 years ago)
- Last Synced: 2025-08-23T18:09:57.202Z (11 months ago)
- Topics: angular, copy
- Language: TypeScript
- Homepage: https://www.npmjs.com/package/ng-nocopy
- Size: 190 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
Awesome Lists containing this project
README
## ng-nocopy
A directive that prevents a user from copying a specific element content.
Also applying no selection rules.
#### how to get started?
install the package.
``` npm i ng-nocopy ```
import it into your module ( app.module )
``` import {NgNocopyModule} from 'ng-nocopy'; ```
```
@NgModule({
...
imports: [
NgNocopyModule
]
});
```
in your component , you can add the directive on your html element to prevent its content from copying.
```
your content
```
This directive has copy Attempted event that fires when the user trying to copy the element content. so you can show him an error message :).
#### Contributing
Pull requests are welcome. For major changes, please open an issue first to discuss what you would like to change.
Please make sure to update the tests as appropriate.