2017-04-22 67 views
0

离子对emulatorUncaught SyntaxError: missing) after argument list,但它正常工作与serve命令:离子未捕获的语法错误:缺少)后仿真参数列表

Fetch(what, callbackf) { 
    return this.woo.getAsync(what).then((result)=> { 
     this.zone.run(() => { 
      callbackf(JSON.parse(result.body)); 
     }); 
    }); 
} 

enter image description here

整个提供商:

import { Injectable, NgZone } from '@angular/core'; 
import { Http } from '@angular/http'; 
import 'rxjs/add/operator/map'; 

import WooCommerceAPI from 'woocommerce-api'; 


@Injectable() 
export class WooCommerce { 

    woo: any = null; 

    constructor(public http: Http, private zone: NgZone) { 
     this.woo = WooCommerceAPI(); 
    } 

    Fetch(what, callbackf) { 
     return this.woo.getAsync(what).then((result)=> { 
      this.zone.run(() => { 
       callbackf(JSON.parse(result.body)); 
      }); 
     }); 
    } 

} 

我不确定它为什么会唠叨,什么时候一切似乎都很好,并且运行时没有错误/问题在浏览器上,这里有什么遗漏吗?

这里是Inoinc信息的情况下,它的相关的一些如何!

Your system information: 

Cordova CLI: 6.5.0 
Ionic Framework Version: 3.0.1 
Ionic CLI Version: 2.2.3 
Ionic App Lib Version: 2.2.1 
Ionic App Scripts Version: 1.3.0 
ios-deploy version: Not installed 
ios-sim version: Not installed 
OS: Windows 7 
Node Version: v6.10.2 
Xcode version: Not installed 
+0

您的callbackf有参数 –

+0

@Nidhinkumar no! )'; this.woo.Fetch('products/categories',(res)=> { // use res ... });'' – Abanoub

回答

0

您试图部署您的应用程序的模拟器是什么样的? 我在Android 6.0(API 23)上遇到同样的问题,但在Android 7.1.1(API 25)上一切正常。

相关问题