Clipboard

The Clipboard API enables copy and pasting to/from the clipboard.

Usage
Clipboard.copy('Hello FAWI');

...

Clipboard.paste().then(
    (resolve) => {
        console.log(resolve);
    },
    (reject) => {
        console.log('Error: ' + reject);
    }
);

...

Clipboard.clear();
window.Clipboard.copy("Hello FAWI");
        
...

window.Clipboard.paste().then(
    (resolve) => {
        console.log(resolve);
    },
    (reject) => {
        console.log("Error: " + reject);
    }
);

...

window.Clipboard.clear();
window.Clipboard.copy("Hello FAWI");
                    
...

window.Clipboard.paste().then(
    (resolve) => {
        console.log(resolve);
    },
    (reject) => {
        console.log("Error: " + reject);
    }
);

... 

window.Clipboard.clear();
(<any>window).Clipboard.copy("Hello FAWI");

...

(<any>window).Clipboard.paste().then(
    (resolve) => {
        console.log(resolve);
    },
    (reject) => {
        console.log("Error: " + reject);
    }
);

...

(<any>window).Clipboard.clear();
window.Clipboard.copy("Hello FAWI");

...

window.Clipboard.paste().then(
    (resolve) => {
        console.log(resolve);
    },
    (reject) => {
        console.log("Error: " + reject);
    }
);
                    
...

window.Clipboard.clear();

Table of Contents

  • Classes
  • Classes


    Clipboard

    copy

    copy(text: string): Promise<any>

    Write a text to the clipboard .


    PARAMETERS
    text: string

    RETURN
    returns: Promise<any>

    paste

    paste(): Promise<string>

    Read a value from the clipboard .


    RETURN
    returns: Promise<string>

    clear

    clear(): Promise<any>

    Clear the text stored in clipboard.


    RETURN
    returns: Promise<any>