mirror of
https://github.com/zhigang1992/angular.js.git
synced 2026-04-19 08:21:03 +08:00
docs($exceptionHandler): add a note about cases when exceptions are not delegated to the
$exceptionHandler Add a note in $exceptionHandler's documentation about cases when exceptions are not delegated to the $exceptionHandler, because they are executed outside of the Angular context. Most notable such cases being the DOM event listeners registered using jqLite's/jQuery's on/bind methods. Closes #7909 Closes #9318
This commit is contained in:
committed by
Igor Minar
parent
2230fb4c10
commit
257a3f35dc
@@ -27,6 +27,14 @@
|
||||
* This example will override the normal action of `$exceptionHandler`, to make angular
|
||||
* exceptions fail hard when they happen, instead of just logging to the console.
|
||||
*
|
||||
* <hr />
|
||||
* Note, that code executed in event-listeners (even those registered using jqLite's `on`/`bind`
|
||||
* methods) does not delegate exceptions to the {@link ng.$exceptionHandler $exceptionHandler}
|
||||
* (unless executed during a digest).
|
||||
*
|
||||
* If you wish, you can manually delegate exceptions, e.g.
|
||||
* `try { ... } catch(e) { $exceptionHandler(e); }`
|
||||
*
|
||||
* @param {Error} exception Exception associated with the error.
|
||||
* @param {string=} cause optional information about the context in which
|
||||
* the error was thrown.
|
||||
|
||||
Reference in New Issue
Block a user