angular-bugsnag

WebJar for angular-bugsnag

Лицензия

Лицензия

MIT
Категории

Категории

Angular Взаимодействие с пользователем Веб-фреймворки
Группа

Группа

org.webjars.bower
Идентификатор

Идентификатор

angular-bugsnag
Последняя версия

Последняя версия

0.2.1
Дата

Дата

Тип

Тип

jar
Описание

Описание

angular-bugsnag
WebJar for angular-bugsnag
Ссылка на сайт

Ссылка на сайт

http://webjars.org
Система контроля версий

Система контроля версий

https://github.com/wmluke/angular-bugsnag

Скачать angular-bugsnag

Как подключить последнюю версию

<!-- https://jarcasting.com/artifacts/org.webjars.bower/angular-bugsnag/ -->
<dependency>
    <groupId>org.webjars.bower</groupId>
    <artifactId>angular-bugsnag</artifactId>
    <version>0.2.1</version>
</dependency>
// https://jarcasting.com/artifacts/org.webjars.bower/angular-bugsnag/
implementation 'org.webjars.bower:angular-bugsnag:0.2.1'
// https://jarcasting.com/artifacts/org.webjars.bower/angular-bugsnag/
implementation ("org.webjars.bower:angular-bugsnag:0.2.1")
'org.webjars.bower:angular-bugsnag:jar:0.2.1'
<dependency org="org.webjars.bower" name="angular-bugsnag" rev="0.2.1">
  <artifact name="angular-bugsnag" type="jar" />
</dependency>
@Grapes(
@Grab(group='org.webjars.bower', module='angular-bugsnag', version='0.2.1')
)
libraryDependencies += "org.webjars.bower" % "angular-bugsnag" % "0.2.1"
[org.webjars.bower/angular-bugsnag "0.2.1"]

Зависимости

compile (2)

Идентификатор библиотеки Тип Версия
org.webjars.bower : angular jar [1,2)
org.webjars.bower » bugsnag jar [3,4)

Модули Проекта

Данный проект не имеет модулей.

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'])

bugsnagProvider configuration

The bugsnagProvider has pretty much the same configuration options as bugsnag.

The main difference is that bugsnagProvider uses chainable setter methods instead of properties.

noConflict

Call noConflict() before other settings to remove bugsnag from window.

apiKey

releaseStage

notifyReleaseStages

appVersion

user

projectRoot

endpoint

metaData

autoNotify

beforeNotify

Takes an angular providerFunction or service name that should return a beforeNotify callback used by bugsnag.

Examples

Log notifications with $log:

bugsnagProvider
    .beforeNotify(['$log', function ($log) {
       return function (error, metaData) {
           $log.debug(error.name);
           return true;
       };
    }])

beforeNotify can also take a service name defined elsewhere:

module
    .factory('bugsnagNotificationInterceptor', ['$log', function ($log) {
        return function (error, metaData) {
            $log.debug(error.name);
            return true;
        };
    }])

bugsnagProvider
    .beforeNotify('bugsnagNotificationInterceptor')

Example Usage

angular.module('demo-app', ['angular-bugsnag'])
    .config(['bugsnagProvider', function (bugsnagProvider) {
        bugsnagProvider
            .noConflict()
            .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();
        };

    }]);

Contributing

PR's are welcome. Just make sure the tests pass.

$ make
$ gulp test

Additionally, use gulp serve or gulp watch to run the test app. Just insert a Bugsnag API Key here. Remember, don't commit your key!

License

MIT

Версии библиотеки

Версия
0.2.1
0.2.0
0.1.3