refactor(-): cleanup
This commit is contained in:
parent
94a8a296c1
commit
2efce5dcb7
@ -156,9 +156,7 @@ function wrapObservable(pluginObj:any, methodName:string, args:any[], opts:any =
|
|||||||
}
|
}
|
||||||
|
|
||||||
function callInstance(pluginObj:any, methodName : string, args:any[], opts:any = {}, resolve? : Function, reject? : Function){
|
function callInstance(pluginObj:any, methodName : string, args:any[], opts:any = {}, resolve? : Function, reject? : Function){
|
||||||
//if(!systemCheck(null, pluginObj, methodName, resolve, reject)) return;
|
|
||||||
args = setIndex(args, opts, resolve, reject);
|
args = setIndex(args, opts, resolve, reject);
|
||||||
console.log("!====!", pluginObj, methodName, args);
|
|
||||||
return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
|
return pluginObj._objectInstance[methodName].apply(pluginObj._objectInstance, args);
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -286,10 +284,8 @@ export function Cordova(opts:any = {}) {
|
|||||||
*/
|
*/
|
||||||
export function CordovaInstance(opts:any = {}) {
|
export function CordovaInstance(opts:any = {}) {
|
||||||
return (target: Object, methodName: string) => {
|
return (target: Object, methodName: string) => {
|
||||||
console.log("P-A", target, methodName, opts);
|
|
||||||
return {
|
return {
|
||||||
value: function(...args: any[]) {
|
value: function(...args: any[]) {
|
||||||
console.log("P-B", ...args);
|
|
||||||
return wrapInstance(this, methodName, opts).apply(this, args);
|
return wrapInstance(this, methodName, opts).apply(this, args);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -306,7 +302,6 @@ export function CordovaProperty(target: Function, key: string, descriptor: Typed
|
|||||||
let originalMethod = descriptor.get;
|
let originalMethod = descriptor.get;
|
||||||
|
|
||||||
descriptor.get = function(...args: any[]) {
|
descriptor.get = function(...args: any[]) {
|
||||||
// console.log('Calling', this);
|
|
||||||
if(!window.cordova) {
|
if(!window.cordova) {
|
||||||
cordovaWarn(this.name, null);
|
cordovaWarn(this.name, null);
|
||||||
return {};
|
return {};
|
||||||
|
@ -1,5 +1,4 @@
|
|||||||
export function get(obj, path) {
|
export function get(obj, path) {
|
||||||
console.log(obj, path);
|
|
||||||
for(var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
|
for(var i = 0, path = path.split('.'), len = path.length; i < len; i++) {
|
||||||
if(!obj) { return null; }
|
if(!obj) { return null; }
|
||||||
obj = obj[path[i]];
|
obj = obj[path[i]];
|
||||||
|
@ -2,7 +2,6 @@
|
|||||||
<html ng-app="app">
|
<html ng-app="app">
|
||||||
<head>
|
<head>
|
||||||
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
|
<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.8/angular.min.js"></script>
|
||||||
<script src="sql.js"></script>
|
|
||||||
<script src="../../dist/ionic.native.js"></script>
|
<script src="../../dist/ionic.native.js"></script>
|
||||||
<script src="app.js"></script>
|
<script src="app.js"></script>
|
||||||
</head>
|
</head>
|
||||||
@ -11,7 +10,5 @@
|
|||||||
<script>
|
<script>
|
||||||
angular.module('app', []);
|
angular.module('app', []);
|
||||||
</script>
|
</script>
|
||||||
<!-- div to test googlemaps plugin -->
|
|
||||||
<div id="gmap"></div>
|
|
||||||
</body>
|
</body>
|
||||||
</html>
|
</html>
|
||||||
|
Loading…
x
Reference in New Issue
Block a user