Search docs/

Clipboard

v1.2.0

Contents

インストール

最初に(一度限りの) セットアップ手順を実行したら, プラグインをインストールします。

Cordova:ionic cordova plugin add @ionic-enterprise/clipboard Capacitor:npm install @ionic-enterprise/clipboard npx cap sync

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