Search docs/

Clipboard

v1.2.0

The Clipboard plugin provides access to the device clipboard, including copy and paste functionality.

Index

Classes


Classes

Clipboard

usage:

import { Clipboard } from '@ionic-enterprise/clipboard/ngx';

constructor(private clipboard: Clipboard) { }

...

this.clipboard.copy('Hello world');

this.clipboard.paste().then(
   (resolve: string) => {
      alert(resolve);
    },
    (reject: string) => {
      alert('Error: ' + reject);
    }
  );

this.clipboard.clear();

clear

clear(): Promise<any>

Clear the text stored in clipboard

Returns: Promise<any> Returns a promise after the text has been cleaned


copy

copy(text: string): Promise<any>

Copies the given text

Parameters:

Name Type Description
text string Text that gets copied on the system clipboard

Returns: Promise<any> Returns a promise after the text has been copied


paste

paste(): Promise<any>

Pastes the text stored in clipboard

Returns: Promise<any> Returns a promise after the text has been pasted



Other Versions