How to handle template errors (and other errors) in angular 2?
问题 When ever there is a template error in angular 2, the entire application fails to work. Shouldn't only the component that had the template that caused the error, fail to work and the rest of the application be working fine? How to handle errors so that the application won't stop being responsive when an error occurs? 回答1: You can use custom ErrorHandler: class MyErrorHandler implements ErrorHandler { handleError(error) { // do something with the exception } } @NgModule({ providers: [{provide: