I am trying to inject a service within a component which uses Http component. I get the above error when i try to inject the Http component within the service. Below is the code for service:
somerservice.ts
import {Injectable} from 'angular2/core';
import {Http, HTTP_PROVIDERS, Headers} from 'angular2/http';
@Injectable()
export class SomeService {
constructor(private _http: Http){}
public someMethod(param: string){}
}
And in somecomponent.ts
@Component({
...
providers: [SomeService]
...
})
What am i missing? Thanks.
it’s not supported anymore, angular 2 final provides module system, RTFM