
Security News
Crates.io Users Targeted by Phishing Emails
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
ngx-copypaste
Advanced tools
NGX COPYPASTE is the best directive to copy any content on any element
You can also try our NGX MASK check it. You can also try our NGX LOADER INDICATOR check it.
$ npm install --save ngx-copypaste
$ bun install --save ngx-copypaste
Pay attention this version works for angular >= 14.0.0
Import ngx-copypaste directive to your standalone component
@Component({
selector: 'ngx-component',
templateUrl: './app.component.html',
styleUrls: ['./app.component.scss'],
standalone: true,
imports: [
(...)
NgxCopyPasteDirective,
(...)
],
})
export class AppComponent {
(...)
}
Pay attention this version works for angular < 15.0.0
Import ngx-copypaste module in Angular app.
import {NgxCopyPasteModule} from 'ngx-copypaste'
(...)
@NgModule({
(...)
imports: [
NgxCopyPasteModule
]
(...)
})
From input
<input type="text" ngxCopyPaste #cp="copy" />
<button (click)="cp.copy()">Copy</button>
From any HTML tag
<p ngxCopyPaste #cp="copy">Lorem ipsum</p>
<button (click)="cp.copy()">Copy</button>
From complex div
<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
<p ngxCopyPaste #cp="copy">Lorem ipsum</p>
<p (click)="cp.copy()">Copy</p>
Output success cb
<p ngxCopyPaste #cp="copy" (successCb)="copy()">Lorem ipsum</p>
<p (click)="cp.copy()">Copy</p>
public copy(): void { your code }
FAQs
Unknown package
The npm package ngx-copypaste receives a total of 206 weekly downloads. As such, ngx-copypaste popularity was classified as not popular.
We found that ngx-copypaste demonstrated a healthy version release cadence and project activity because the last version was released less than a year ago. It has 0 open source maintainers collaborating on the project.
Did you know?
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.
Security News
The Rust Security Response WG is warning of phishing emails from rustfoundation.dev targeting crates.io users.
Product
Socket now lets you customize pull request alert headers, helping security teams share clear guidance right in PRs to speed reviews and reduce back-and-forth.
Product
Socket's Rust support is moving to Beta: all users can scan Cargo projects and generate SBOMs, including Cargo.toml-only crates, with Rust-aware supply chain checks.