So I have some pretty simple code for making a get request right now:
import {Injectable} from 'angular2/core';
import {Http} from 'angular2/http';
@Injectable()
export class HttpService {
static get parameters() {
return [[Http]];
}
constructor(http) {
this.http = http;
}
makeGetRequest() {
this.http.get("http://httpbin.org/ip").subscribe(data => {
alert(data.json().origin);
}, error => {
alert("Error");
});
}
}
which won’t even load the app because I get the error
2 087280 error EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: No provider for Http!
What step am I missing here?