ng-clipboard-antd
v2.0.1
Published
A wrapper directive for clipboard.js, and base on ng-zorro-antd.
Downloads
28
Maintainers
Readme
ng-clipboard-antd
A wrapper directive for clipboard.js, and base on ng-zorro-antd.
The core function is ported from clipboard.js(@zenorocha) & ngx-clipboard(@maxisam), thanks.
Demo
1、Install
npm install ng-clipboard-antd --save
Import the NzClipboardModule
in to your projects.
import { NzClipboardModule } from 'ng-clipboard-antd';
@NgModule({
imports: [
NzClipboardModule.forRoot()
]
})
export class AppModule { }
2、Usage
nz-clipboard
<button nz-button [nz-clipboard]="'Content from ng-clipboard-antd'">Copy</button>
| Name | Type | Default | Remark |
| ------- | ------------- | ----- | ----- |
| [nzTarget]
| HTMLInputElement
NzInputComponent
| | copy from a input or nz-input |
| [nzSuccessText]
| string
| 复制成功 | text of the success |
| [nzErrorText]
| string
| 复制失败 | text of the error |
| (nzSuccess)
| EventEmitter
| | a success callback |
| (nzError)
| EventEmitter
| | a error callback |
NzClipboardService
constructor(private srv: NzClipboardService) {}
copy() {
this.srv.copyFromContent(`time ${+new Date}`);
}
Troubleshooting
Please follow this guidelines when reporting bugs and feature requests:
- Use GitHub Issues board to report bugs and feature requests (not our email address)
- Please always write steps to reproduce the error. That way we can focus on fixing the bug, not scratching our heads trying to reproduce it.
Thanks for understanding!
License
The MIT License (see the LICENSE file for the full text)