Skip to content

nivler/angular-bugsnag

 
 

Repository files navigation

angular-bugsnag

Angular wrapper for Bugsnag.

Build Status Coverage Status

Specifically, angular-bugsnag does the following...

  • Provides bugsnagProvider to configure the bugsnag client and also to inject bugsnag as needed
  • Overrides the default angular $exceptionHandler to send uncaught exceptions to Bugsnag

Installation

Download angular-bugsnag.js or install with bower.

$ bower install angular-bugsnag --save

Load the angular-bugsnag module into your app...

angular.module('app', ['angular-bugsnag'])

Example Usage

angular.module('demo-app', ['angular-bugsnag'])
    .config(['bugsnagProvider', function (bugsnagProvider) {
        bugsnagProvider
            .apiKey('[replace me]')
            .releaseStage('development')
            .user({
                id: 123,
                name: 'Jon Doe',
                email: 'jon.doe@gmail.com'

            })
            .appVersion('0.1.0')
            .beforeNotify(['$log', function ($log) {
                return function (error, metaData) {
                    $log.debug(error.name);
                    return true;
                };
            }]);
    }])
    .controller('MainCtrl', ['$rootScope', 'bugsnag', function ($scope, bugsnag) {

        this.throwError = function (err) {
            throw err;
        };

        this.notifyError = function (err) {
            bugsnag.notify(err);
        };

        this.brokenUndefined = function () {
            $scope.foo.bar();
        };

    }]);

License

MIT

About

Angular wrapper for Bugsnag

Resources

Stars

Watchers

Forks

Packages

No packages published

Languages

  • JavaScript 99.1%
  • CSS 0.9%