Angular2路由不';组件构造函数中出现异常后无法工作

Angular2路由不';组件构造函数中出现异常后无法工作,angular,angular2-routing,Angular,Angular2 Routing,我在组件的构造函数或ngOnInit函数中抛出错误 它由我的CustomErrorHandler处理,但在它发生之前,它会中断路由 Uncaught(承诺中):错误:错误http://localhost:8666/app/modules/orders/orders.component.html:1:46 原因:构造函数错误 错误:错误在http://localhost:8666/app/modules/orders/orders.component.html:1:46 原因:ViewWrapp

我在组件的构造函数或ngOnInit函数中抛出错误

它由我的CustomErrorHandler处理,但在它发生之前,它会中断路由

Uncaught(承诺中):错误:错误http://localhost:8666/app/modules/orders/orders.component.html:1:46 原因:构造函数错误
错误:错误在http://localhost:8666/app/modules/orders/orders.component.html:1:46 原因:ViewWrappedError.ZoneAwareError处的构造函数错误
(http://localhost:8666/node_modules/zone.js/dist/zone.js:811:33)在ViewWrappedError.BaseError[作为构造函数]
(http://localhost:8666/node_modules/@angular/core/bundles/core.umd.js:1190:20)位于ViewWrappedError.WrappedError[作为构造函数]
(http://localhost:8666/node_modules/@angular/core/bundles/core.umd.js:1248:20)在新ViewWrappedError
(http://localhost:8666/node_modules/@angular/core/bundles/core.umd.js:6633:20),位于CompiledTemplate.proxyViewClass.DebugAppView.\u rethrowWithContext
(http://localhost:8666/node_modules/@CompiledTemplate.proxyViewClass.DebugAppView.detectChanges中的angular/core/bundles/core.umd.js:12903:27)
(http://localhost:8666/node_modules/@CompiledTemplate.proxyViewClass.AppView.internalDetectChanges中的angular/core/bundles/core.umd.js:12876:22)
(http://localhost:8666/node_modules/@角度/core/bundles/core.umd.js:12711:22)在CompiledTemplate.proxyViewClass.View\u OrdersComponent\u Host0.detectChanges内部
(/OrdersModule/OrdersComponent/host.ngfactory.js:29:19)位于CompiledTemplate.proxyViewClass.AppView.detectChanges
(http://localhost:8666/node_modules/@CompiledTemplate.proxyViewClass.DebugAppView.detectChanges中的angular/core/bundles/core.umd.js:12726:18)
(http://localhost:8666/node_modules/@角度/核心/束/核心.umd.js:12873:48)在ViewRef_uu.detectChanges
(http://localhost:8666/node_modules/@RouterOutlet.activate上的angular/core/bundles/core.umd.js:9915:24)
(http://localhost:8666/node_modules/@angular/router/bundles/router.umd.js:5027:46)位于ActivateRoutes.placeComponentOutlet
(http://localhost:8666/node_modules/@ActivateRoutes.ActivateRoutes上的angular/router/bundles/router.umd.js:4302:20)
(http://localhost:8666/node_modules/@角度/路由器/捆绑包/路由器.umd.js:4269:30)

(http://localhost:8666/node_modules/@angular/router/bundles/router.umd.js:4205:62)
我认为这是预期的行为。
在自定义错误处理程序中调用
ApplicationRef.tick()
,应该可以使路由再次工作。

我认为这是预期的行为。
在自定义错误处理程序中调用
ApplicationRef.tick()
,将使路由重新工作。

@Cuel通常情况下,异常是应用程序失败。自定义错误处理程序仅允许您进行错误日志记录(例如,记录到服务器)。无法保证在发生未捕获的异常后,应用程序处于或能够恢复到可用状态。@提示通常,异常是应用程序失败。自定义错误处理程序仅允许您进行错误日志记录(例如,记录到服务器)。无法保证应用程序在发生未捕获异常后恢复到可用状态。