@srjovanovic wrote:
I’ve created HttpInterceptor, and I’m using Events in constructor as shown. I’ve wrote TestBed for it, but when I start Karma, it shows an error:
Error: StaticInjectorError[Events]:
StaticInjectorError[Events]:
NullInjectorError: No provider for Events!
How can I provide Events in TestBed?// My HttpInterceptor
import {HttpEvent, HttpHandler, HttpInterceptor, HttpRequest} from “@angular/common/http”;
import {Injectable} from “@angular/core”;
import {Events} from “ionic-angular”;
import {Observable} from “rxjs/Observable”;@Injectable()
export class APIAuthInterceptorProvider implements HttpInterceptor {
private userProfileDetails;
private clubProfileDetails;constructor(private connectionEvent: Events) { }
. . .
Posts: 1
Participants: 1