44
是否有可能全局捕獲在Angular2應用程序中拋出的異常,以防止整個應用程序從任何一個組件中的錯誤中斷?Angular2全局異常處理
是否有可能全局捕獲在Angular2應用程序中拋出的異常,以防止整個應用程序從任何一個組件中的錯誤中斷?Angular2全局異常處理
正如谷歌解釋,你可以重寫錯誤處理服務來做你想做的。 https://angular.io/docs/ts/latest/api/core/index/ErrorHandler-class.html
請參閱示例http://stackoverflow.com/questions/37592078/cyclic-dependency-when-ovveriding-exceptionhandler/37609925#37609925,http://stackoverflow.com/questions/37609725/how-to-inject -my-service-to-exceptionhandler/37609799#37609799,http://stackoverflow.com/questions/37793276/angular-2-custom-exceptionhandler-change-detection-lag/37793791#37793791,http://stackoverflow.com/questions/35238428/angular2-application-crashes-become-unresponsive-after-encounter-an-except/35239028#35239028, –
http://stackoverflow.com/questions/37879654/angular-2-rc-2-how-對注射路由器 - 到 - 定製的ExceptionHandler/37879714#37879714 –