When using Ionic, I encountered an error
Uncaught SyntaxError: missing ) after argument list
on the emulator
, but everything runs smoothly with the serve
command:
Fetch(what, callbackf) {
return this.woo.getAsync(what).then( (result)=> {
this.zone.run(() => {
callbackf(JSON.parse(result.body));
});
});
}
https://i.sstatic.net/MSRwt.png
The entire provider code is as follows:
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));
});
});
}
}
I'm confused about why this error is showing up when everything seems to be working fine without any issues in the browser. Am I overlooking something here?
Here are the details of my Inoinc
setup in case it's relevant:
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