I am trying to remove component dependency on services in Angular using Redux.
Basically, the flow Component β Action β Service
In the service, I want to use the @ angular / core http module, which is proposed to be passed in the constructor:
export class SampleService {
constructor(public http: Http) {}
}
And since I call the service from the action, it will not get the http provider, since I do not have an instance of the http provider.
export default class SampleAction {
private _projectService;
constructor() {
this._sampleService = new SampleService();
}
}
How can I enter the http provider into the service?
source
share