You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: docs/integrations/angular.rst
+87-20Lines changed: 87 additions & 20 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -4,44 +4,111 @@ AngularJS
4
4
.. versionadded:: 1.3.0
5
5
Prior to 1.3.0, we had an Angular plugin, but was undocumented. 1.3.0 comes with a rewritten version with better support.
6
6
7
+
To use Sentry with your Angular application, you will need to use both Raven.js (Sentry's browser JavaScript SDK) and the Raven.js Angular plugin.
8
+
9
+
On its own, Raven.js will report any uncaught exceptions triggered from your application. For advanced usage examples of Raven.js, please read :doc:`Raven.js usage <usage>`.
10
+
11
+
Additionally, the Raven.js Angular plugin will catch any Angular-specific exceptions reported through Angular's ``$exceptionHandler`` interface.
12
+
13
+
**Note**: The Angular integration supports Angular 1.x.
14
+
7
15
Installation
8
16
------------
9
17
10
-
Start by adding the ``raven.js`` script tag to your page. It should go **before** your application code.
18
+
Raven.js and the Raven.js Angular plugin are distributed using a few different methods.
19
+
20
+
Using our CDN
21
+
~~~~~~~~~~~~~
22
+
23
+
For convenience, our CDN serves a single, minified JavaScript file containing both Raven.js and the Raven.js Angular plugin. It should be included **after** Angular, but **before** your application code.
At this point the SDK will capture Angular-specific errors, as well as general JavaScript
47
-
issues that may happen outside of the scope of the framework.
79
+
These examples assume that Angular is exported globally as `window.angular`. You can alternatively pass a reference to the `angular` object directly as the second argument to `addPlugin`:
80
+
81
+
.. code-block:: javascript
82
+
83
+
Raven.addPlugin(Raven.Plugins.Angular, angular);
84
+
85
+
Module loaders (CommonJS)
86
+
~~~~~~~~~~~~~~~~~~~~~~~~~
87
+
88
+
Raven and the Raven Angular plugin can be loaded using a module loader like Browserify or Webpack.
0 commit comments