Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork22
Angular Example
Exceptionless will automatically capture any unhandled errors that are thrown. However, angular errors are sent through an$exceptionHandler service. To fully integrate with angular we need to add anExceptionless integration for Angular! Doing so will cause Exceptionless to start collecting unhandled Angular errors, 404s, and $log messages quickly.
- Add the Exceptionless and Angular integrations scripts to you page.
<scriptsrc="bower_components/exceptionless/dist/exceptionless.js"></script><scriptsrc="bower_components/exceptionless/dist/integrations/angular.js"></script>
- Finally, import the
exceptionlessAngular module and inside of your app's configure message set the api key and any other settings.
varapp=angular.module('myApp',['exceptionless']);app.config(function($ExceptionlessClient){$ExceptionlessClient.config.apiKey='YOUR_API_KEY';$ExceptionlessClient.config.setUserIdentity('12345678','Blake');$ExceptionlessClient.config.useSessions();$ExceptionlessClient.config.defaultTags.push('Example','JavaScript','Angular');});
We have built a quickAngular sample app you can play around with.
Run the sample app by following the steps below:
- InstallNode.js (this is only required to run the http server)
- Clone or download our repository from GitHub.
- Navigate to the example\angular folder via the command line (e.g., cd example\angular)
- Open app.constants.js in your favorite text editor and set theapiKey and server url. If you are not running a local Exceptionless server, please comment outthis line.
- Run
npm start. - Navigate tohttp://localhost:8000 in your browser to view the angular app.
- To create an error, click any of the links to load the partial views.
We recommend enabling debug logging by calling$ExceptionlessClient.config.useDebugLogger();. This will output messages to the console regarding what the client is doing. Please contact us by creating an issue on GitHub if you need assistance or have any feedback for the project.
Looking forGeneral Exceptionless Documentation,UI Documentation, orDocumentation for another Client?
Visit the Primary Exceptionless Documentation Page and go from there.