yea toast

This commit is contained in:
Max Lynch
2015-11-28 16:52:05 -06:00
parent 4b519753d2
commit 044a824f29
7 changed files with 74 additions and 3 deletions
+24 -2
View File
@@ -1,5 +1,20 @@
import {Page, NavParams} from 'ionic/ionic';
import {Camera, StatusBar, Toast} from 'ionic-native';
// To specify arguments for any plugin calls
var demoArgs = {};
demoArgs[Toast] = {
showWithOptions: [
{
message: "hey there",
duration: "short",
position: "bottom",
addPixelsY: -40 // added a negative value to move it up a bit (default 0)
}
]
}
@Page({
templateUrl: 'app/plugin/plugin.html',
})
@@ -18,10 +33,17 @@ export class Plugin {
}
doMethod(method) {
console.log('Doing method', method, 'on Plugin', this.plugin);
let pluginMethodArgEntry = demoArgs[this.plugin];
let args = [];
if(pluginMethodArgEntry) {
args = pluginMethodArgEntry[method] || [];
}
console.log('Doing method', method, 'on Plugin', this.plugin, 'args:', args);
// TODO: Pass args
this.plugin[method].apply(this.plugin);
this.plugin[method].apply(this.plugin, args);
}
}