I'm getting the following error while trying to use the nativescript-clipboard plugin within a nativescript-angular app. Because I'm new to nativescript I'm most likely doing something wrong.
This is the complete error:
Error in clipboard.setText: TypeError: Cannot read property 'getSystemService' of undefined (/home/linuxtest/sample-ng-todomvc/node_modules/nativescript-clipboard/clipboard.android.js:13:15) I'm
currently have version 1.1.3 of the plugin.
And here is the section where I'm trying to use your plugin
import {Component} from "angular2/core";
var clipboardModule = require("nativescript-clipboard");
@Component({
selector: "my-clipboard",
templateUrl: "templates/my-clipboard.html"
})
export class MyClipboard {
greeting:string;
constructor(){
this.greeting = "Hello Github!";
}
save(text) {
clipboardModule.setText(text).then(()=>{
console.log(texto + ", copied to clipboard");
});
}
read() {
clipboardModule.getText().then((content)=>{
console.log("Read from clipboard: " + content);
});
}
}
Thanks in advance!