{ "html": "
Raven.js and the Raven.js Angular plugin are distributed using a few different methods.
\nFor convenience, our CDN serves a single, minified JavaScript file containing both Raven.js and the Raven.js AngularJS plugin. It should be included after Angular, but before your application code.
\nExample:
\n<script src="https://ajax.googleapis.com/ajax/libs/angularjs/1.4.5/angular.min.js"></script>\n<script src="https://cdn.ravenjs.com/3.20.1/angular/raven.min.js" crossorigin="anonymous"></script>\n<script>Raven.config('___PUBLIC_DSN___').install();</script>\n
Note that this CDN build auto-initializes the Angular plugin.
\nPre-built distributions of Raven.js and the Raven.js AngularJS plugin are available via both Bower and npm.
\n$ bower install raven-js --save\n
<script src="/bower_components/angular/angular.js"></script>\n<script src="/bower_components/raven-js/dist/raven.js"></script>\n<script src="/bower_components/raven-js/dist/plugins/angular.js"></script>\n<script>\n Raven\n .config('___PUBLIC_DSN___')\n .addPlugin(Raven.Plugins.Angular)\n .install();\n</script>\n
$ npm install raven-js --save\n
<script src="/node_modules/angular/angular.js"></script>\n<script src="/node_modules/raven-js/dist/raven.js"></script>\n<script src="/node_modules/raven-js/dist/plugins/angular.js"></script>\n<script>\n Raven\n .config('___PUBLIC_DSN___')\n .addPlugin(Raven.Plugins.Angular)\n .install();\n</script>\n
These examples assume that AngularJS is exported globally as window.angular. You can alternatively pass a reference to the angular object directly as the second argument to addPlugin:
\nRaven.addPlugin(Raven.Plugins.Angular, angular);\n
Raven and the Raven AngularJS plugin can be loaded using a module loader like Browserify or Webpack.
\nvar angular = require('angular');\nvar Raven = require('raven-js');\n\nRaven\n .config('___PUBLIC_DSN___')\n .addPlugin(require('raven-js/plugins/angular'), angular)\n .install();\n
Note that when using CommonJS-style imports, you must pass a reference to angular as the second argument to addPlugin.
\n