Ionic 2 http.get() issue
I tried to make a http.get() call with these two methods. First: getResults(){ return this.http.get('http://localhost/api.php') .toPromise() .then( data => data.json() ); } Error Shown: 3 122412 error EXCEPTION: Uncaught (in promise): Response with status:0 for URL: null 4 122413 error ORIGINAL STACKTRACE: 5 122413 error Error: Uncaught (in promise): Response with status: 0 for URL: null .......... Second: getResults(){ return new Promise((resolve, reject) => { this.http.get('http://localhost/api.php') .map(res => res.json()) .subscribe(data => { resolve(data); }, (err) => { reject(err); }); }