ZeroClipboard for angular
npm install ngx-zeroclipboard

+ lazy load zeroclipboard.js
```
npm install ngx-zeroclipboard --save
import UEditorModule
`typescript
import { ZeroClipboardModule } from 'ngx-zeroclipboard';
@NgModule({
imports: [
BrowserModule,
ZeroClipboardModule.forRoot({
// ZeroClipboard.js URL
path: './assets/zeroclipboard/dist/ZeroClipboard.js',
// Configuration Options
// see:https://github.com/zeroclipboard/zeroclipboard/blob/master/docs/api/ZeroClipboard.md#configuration-options
config: {
title: 'Copy me!'
}
})
],
declarations: [AppComponent],
bootstrap: [AppComponent]
})
export class AppModule { }
`
`html`
zeroclipboard [zcData]="data" [zcType]="'text'" #copy="zcDirective"
(ready)=""
(beforecopy)=""
(copy)=""
(aftercopy)=""
(destroy)=""
(error)="">Copy
| Name | Type | Default | Summary |
| ------- | ------------- | ----- | ----- |
| zcData | string | | copy data |
| zcType | 'text' | 'html' | 'richText' | 'text' | |
| ready | Function | | |
| beforecopy | Function | | |
| copy | Function | | |
| aftercopy | Function | | |
| destroy | Function | | |
| error | Function | | |
`typescript
@Component({
template: `
})
export class DemoComponent {
@ViewChild('copy') copy: ZeroClipboardDirective;
}
`typescript
interface ZeroClipboardDirective {
/**
* 获取Zeroclipboard实例
*/
get Instance(): any {}
/**
* 重新设置全局配置
*/
reConfig(cog: ZeroClipboardGlobalConfig) {}
}
``
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!
The MIT License (see the LICENSE file for the full text)