Just cant figure out why I have still getting this missing Headers provider issue.
My bootstrap.ts:
import {enableProdMode, provide} from \"angular2/
The Headers
class can't be injected. You need to instantiate it by your own:
constructor(http: Http) {
let headers = new Headers();
headers.append('Content-Type', 'application/json');
headers.append('Access-Control-Allow-Origin', '*');
this.people = http.get('http://www.mocky.io/v2/5715f13a1100004d1187d9e1', { headers: headers })
.map(response => response.json());
}
There is no need to inject Headers
. Just create it with
let headers = new Headers();