Angular2 RC5 ExceptionHandler 的变化?

Change in Angular2 RC5 ExceptionHandler?

我正在将我的 Angular2 代码迁移到 RC5,但不知道如何连接我的异常处理。在 RC4 中,它是 Main.ts:

引导过程的一部分
bootstrap(MyApp, [{provide: ExceptionHandler, useClass: GlobalExceptionHandler}])

但是现在我们有了 app.module.ts,我不确定如何包含对 ExceptionHandler 的引用并将其指向 GlobalErrorHandler。我的新 app.module.ts 如下:

import { NgModule } from "@angular/core";
import { BrowserModule  } from "@angular/platform-browser";
import { FormsModule } from "@angular/forms";
import { AppComponent }   from "./app.component";
import { ExceptionHandler } from "@angular/core";
import { GlobalErrorHandler } from "./shared/utils/global-error-handler";
import { ExceptionApiService } from "./shared/utils/exception-api-service";
import { HomeComponent }   from "./home/home.component";
import { ContentManagementComponent } from "./contentManagement/content-management.component";
import { GetContentComponent } from "./getContent/get-content.component";
import { AddContentComponent } from "./addContent/add-content.component";
import { ErrorComponent } from "./errorPage/error.component";
import { appRoutingProviders, APP_ROUTER_PROVIDERS } from "./app.routes";
import { APP_PROVIDERS } from "./app.providers";

@NgModule({
    imports:      [ BrowserModule, FormsModule, APP_ROUTER_PROVIDERS ],
    declarations: [ AppComponent, HomeComponent,     ContentManagementComponent, GetContentComponent, AddContentComponent, ErrorComponent ],
    providers:    [ appRoutingProviders, APP_PROVIDERS, GlobalErrorHandler, ExceptionApiService ],
    bootstrap:    [ AppComponent ]
})

// How to bootstrap ExceptionHandler and point at GlobalErrorHandler??

export class AppModule {}

有什么想法吗?与 ExceptionHandling 相关的文档并不多......特别是对于 RC5 :)

与其他供应商类似,您需要将其注入到您的模块中。

@NgModule({
    imports:      [ BrowserModule, FormsModule, APP_ROUTER_PROVIDERS ],
    declarations: [ AppComponent, HomeComponent,     ContentManagementComponent, GetContentComponent, AddContentComponent, ErrorComponent ],
    providers:    [ appRoutingProviders, APP_PROVIDERS, {provide: ExceptionHandler, useClass: GlobalExceptionHandler}, ExceptionApiService ],
    bootstrap:    [ AppComponent ]
})