For a test I have the following code added to my test.ts, which I included in the main.ts.
var http:Http;
let headers = new Headers();
headers.set('Accept', 'text/json');
let url = 'http://localhost:8080/usersdto';
http.get(url, { headers})
.subscribe(resp => showResponse(resp), err => showResponse(err));
So this is no Class, just typescript. I get the error pointing to line 'http.get' (showResponse exists as function):
Uncaught TypeError: Cannot read property 'get' of undefined
Why do I get this Error and how do I define the http object correctly ?