Skip to content
This repository has been archived by the owner on Jan 8, 2019. It is now read-only.

Latest commit

 

History

History

example

Bugsnag: Angular Example

This example shows how you can use the Bugsnag JavaScript notifier with Angular 2+.

Whilst the notifier reports any errors that are uncaught, there are certain errors within Angular that get caught by its own error handler and only logged to the console. These errors will never make it to Bugsnag by themselves and so require a little wiring up. This is where the bugsnag-angular plugin steps in…

Setup

This project was generated with Angular CLI version 1.3.0. Run ng serve for a dev server and navigate to http://localhost:4200/. The app will automatically reload if you change any of the source files.

Try this out with your own Bugsnag account! You'll be able to see how the errors are reported in the dashboard, how breadcrumbs are left, how errors are grouped and how they relate to the original source.

To get set up, follow the instructions below. Don't forget to replace the placeholder API token with your own!

  1. Clone the repo and cd this this directory:
    git clone https://github.com/bugsnag/bugsnag-angular.git
    cd bugsnag-angular/example
  2. Install the dependencies (with either npm or yarn):
    npm i
    yarn
  3. Replace the API_KEY placeholder in bugsnag.ts with your actual API key.
  4. Build the application and start the development web server:
    npm start
  5. View the example page which will (most likely) be served at: http://localhost:4200/