This commit is contained in:
Max Lynch
2015-11-29 17:20:11 -06:00
parent 45dc983752
commit 9d54bfcd0b
18 changed files with 275 additions and 42 deletions
+8 -1
View File
@@ -1,6 +1,12 @@
import {Page, NavController} from 'ionic/ionic'
import {ActionSheet, Camera, StatusBar, Toast} from 'ionic-native';
import {
ActionSheet,
Camera,
Device,
StatusBar,
Toast
} from 'ionic-native';
import {Plugin} from '../plugin/plugin';
@@ -14,6 +20,7 @@ export class HomePage {
this.plugins = [
ActionSheet,
Camera,
Device,
StatusBar,
Toast
];
+12 -6
View File
@@ -59,12 +59,18 @@ export class Plugin {
addPixelsY: -40 // added a negative value to move it up a bit (default 0)
});
console.log('Doing method', method, 'on Plugin', this.plugin, 'args:', args);
// TODO: Pass args
this.plugin[method].apply(this.plugin, args).then(() => {
console.log('Success', arguments);
}, (err) => {
console.error('Error', err);
});
let v = this.plugin[method].apply(this.plugin, args);
if(v && v.then) {
v.then(() => {
console.log('Success', arguments);
}, (err) => {
console.error('Error', err);
});
} else {
console.log('Response: ', v);
}
}
}