在 httpInterceptor 的构造函数中传递的变量未分配给 "this" 对象 - angular2-rc4

variable passed in constructor of httpInterceptor is not getting assigned to "this" object - angular2-rc4

我按照本教程创建了一个 http 拦截器。
https://www.illucit.com/blog/2016/03/angular2-http-authentication-interceptor/

下面是我的代码:

import {Injectable} from '@angular/core';
import {Http, Request, RequestOptionsArgs, Response, RequestOptions, ConnectionBackend} from '@angular/http';
import { Observable } from 'rxjs/Observable';
import 'rxjs/add/operator/catch';
import 'rxjs/Rx';
import {EventEmitterService} from '../service/event.emitter';


export class CustomHttp extends Http {
    constructor(backend: ConnectionBackend, defaultOptions: RequestOptions, private _eventEmitterService: EventEmitterService) {
        super(backend, defaultOptions);
        alert(this._eventEmitterService); //Undefined
        alert(_eventEmitterService); //gives object
    }

    request(url: string | Request, options?: RequestOptionsArgs): 
      Observable<Response> {
        /* CUSTOM CODE GOES HERE SEE EXAMPLE BELOW*/
        return this.intercept(super.request(url , options));
    }

    get(url: string, options?: RequestOptionsArgs): Observable<Response> { 
        console.log('get...');
        return this.intercept(super.get(url, options));
       // super.get(url, options).catch(res=>{alert(res);return Observable.throw(res)})
    }

    intercept(observable: Observable<Response>): Observable<Response> {
         return observable.catch((err, source) => {
            if (err.status  == 401) {
                this._eventEmitterService.get('authenticationFailed').emit('true'); //this._eventEmitterService is undefined
            } 
            return Observable.throw(err);

        });
    }
}

下面是 bootstrap 的代码:

bootstrap(AppComponent, [ disableDeprecatedForms(),provideForms(), EventEmitterService, 
    provide(Http, {
        useFactory: (backend: XHRBackend, defaultOptions: RequestOptions, eventEmitterService: EventEmitterService) 
           => new CustomHttp(backend, defaultOptions, eventEmitterService),
        deps: [XHRBackend, RequestOptions, EventEmitterService]
    })
]); 

如果您看到 CustomHttp 的构造函数,我正在注入 EventEmitterService 的对象。但是这个对象没有被分配给 class 的 "this" 对象。因此我无法在 "interceptor" 方法中使用。
我做错了什么?

我找到了这个问题的根本原因。在这里张贴,以便它可以帮助其他人。
上面贴出的代码没有错误。
我已将 { path: '', pathMatch: 'prefix',redirectTo: 'test'} 添加到我的路由中。当我删除这个默认路由选项时,它开始工作了。所以我认为问题在于重定向。当我们做重定向的时候,就出现了这个问题。
谢谢