I\'m trying to use the following code after trying several ways online tutorials I can not make it work.
..//
import {Http, HTTP_PROVIDERS} from \'angular2/h
Seems like somehow Http
isn't get injected correctly. Use @Inject
to inject Http
dependency.
import { Component, Inject} from 'angular2/core';
//above code should be at start.
constructor(@Inject(Http) http: Http) {
@Inject
is needed for acquiring dependency when not using Typescript for transpilation of JS.