Clipboard

v1.2.0

Contents

Installation

In order to use Ionic Enterprise Edition plugins you should make sure you're using the Ionic Enterprise Cordova CLI as the regular version can have issues with scoped plugins.

npm uninstall -g cordovanpm install -g @ionic-enterprise/cordova

Once you've installed the Ionic Enterprise Cordova CLI you can install the plugin.

ionic enterprise register --key=YOURPRODUCTKEYionic cordova plugin add @ionic-enterprise/clipboard

Index

Classes


Classes

Clipboard

Clipboard:

name: Clipboard

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

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