I have found some fantastic links for DI explanations in Angular2, but I am still unable to get it working on Safari. In the code below, it works in Firefox and Chrome, but I still get a Can't resolve all parameters for ApiService: (Http, ?).
in Safari. Am I missing something?
import { Injectable } from '@angular/core';
import { Http, Response, RequestOptions, URLSearchParams } from '@angular/http';
import { Observable } from 'rxjs/Rx';
import { EmitterService } from '../services/emitter.service';
@Injectable()
export class ApiService {
constructor (
private http: Http,
private window: Window
) {}
}
From what I can tell everything is there, is there a known cross-browser compatibility issue that I am missing? Or maybe a polyfill for safari specifically?
- I have setup the @NgModules to include
HttpModule
as well.
import { HttpModule } from '@angular/http';