hi ,
I got an error at http.get request ionic typescript that in below.
please help me .
how can I fix this issue.
/////////////////////////////////////////////////////////////////
import {RequestOptions ,Http} from ‘@angular/http’;
import ‘rxjs/add/operator/map’;
import ‘rxjs/add/operator/timeout’;
constructor(public navCtrl: NavController,
private _http: Http,
) {
this.http=_http;}
this.http.get(path)
.timeout(timeoutMS)
.map(res => res.json()).subscribe(data => {
let response = data;
// work with your response data here!
},
err => { // communication error with server or timeout
console.log(' encountered an error');
});
///////////////////////////////////////////////////
result :
TypeError: Cannot read property ‘get’ of undefined
at Object. (http://localhost:8100/build/main.js:2382:23)
at fire (http://localhost:8100/build/vendor.js:148633:30)
at Object.fireWith (http://localhost:8100/build/vendor.js:148743:7)
at Object.fire [as resolve] (http://localhost:8100/build/vendor.js:148750:10)
at Object. (http://localhost:8100/build/vendor.js:119535:26)
at http://localhost:8100/build/vendor.js:148312:12