Clipboard

Improve this doc

$ ionic plugin add https://github.com/VersoSolutions/CordovaClipboard.git
$ npm install --save @ionic-native/clipboard

Repo: https://github.com/VersoSolutions/CordovaClipboard

Clipboard management plugin for Cordova that supports iOS, Android, and Windows Phone 8.

Requires Cordova plugin: https://github.com/VersoSolutions/CordovaClipboard For more info, please see the Clipboard plugin docs.

Supported platforms

Usage

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

constructor(private clipboard: Clipboard) { }

...


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

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

Instance Members

copy(text)

Copies the given text

Param Type Details
text string

Text that gets copied on the system clipboard

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

paste()

Pastes the text stored in clipboard

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

API

Native

General