ngx-simpler-copy
TypeScript icon, indicating that this package has built-in type declarations

0.0.3 • Public • Published

Ngx Simpler Copy

Just for copy text to clipboard, only that !!!

how to:

  1. import NgxSimplerCopyModule:
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';

import { AppComponent } from './app.component';
import { NgxSimplerCopyModule } from 'ngx-simpler-copy';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule,
    NgxSimplerCopyModule,
  ],
  providers: [],
  bootstrap: [AppComponent]
})
export class AppModule { }
  1. use directive or exist function:
import { Component } from '@angular/core';
import { simplerCopyText } from 'ngx-simpler-copy';

@Component({
  selector: 'app-root',
  templates: `
  <div>
    <p #mySimpler="simplerCopy" simplerCopy>
        08111111111111
    </p>
    <div>
        <button (click)="mySimpler.copy('08111111111111')">
        Copy
        </button>
        &nbsp;
        <button (click)="copyHiThere('Hi, There !!!')">
        Copy "Hi, There !!!"
        </button>
    </div>
  </div>
  `,
  styles: [``]
})
export class AppComponent {
  copyHiThere(text: string): void {
    simplerCopyText(text);
  }
}

Contributes:

Package Sidebar

Install

npm i ngx-simpler-copy

Weekly Downloads

0

Version

0.0.3

License

MIT

Unpacked Size

22.6 kB

Total Files

19

Last publish

Collaborators

  • agung96tm