2.0.1 • Published 6 years ago

ng-clipboard-antd v2.0.1

Weekly downloads
16
License
MIT
Repository
github
Last release
6 years ago

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.

NPM version

Demo

Live 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>
NameTypeDefaultRemark
[nzTarget]HTMLInputElement NzInputComponentcopy from a input or nz-input
[nzSuccessText]string复制成功text of the success
[nzErrorText]string复制失败text of the error
(nzSuccess)EventEmittera success callback
(nzError)EventEmittera 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:

  1. Use GitHub Issues board to report bugs and feature requests (not our email address)
  2. 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)