angular - Angular2: Application crashes/ becomes unresponsive after encountering an exception/ error -
how tell angular not block whole application when encounters exception?
i'm not sure if it's possible because google didn't enlighten me on this. seems critical single page web application.
angular fast , whenever encounters exception , throws error, complete application becomes unresponsive.
i know in javascript
try { dosomething(); } catch(err) { handleerrors(err); }
might solve problem.
but want know if there angular specific solution or workaround ?
on angular 2 final version, can implement custom errorhandler.
import {ngmodule, errorhandler} '@angular/core'; class myerrorhandler implements errorhandler { handleerror(error) { // exception } } @ngmodule({ providers: [{provide: errorhandler, useclass: myerrorhandler}] }) class mymodule {}
Comments
Post a Comment