angular-airbrake
TypeScript icon, indicating that this package has built-in type declarations

0.1.2 • Public • Published

Angular (2+) Airbrake Integration

Build Status Coverage Status

This package provides an Angular 2+ service for logging to Airbrake.

Installation

npm install angular-airbrake

Dependencies

This module relies on the official airbrake-js npm package. In addition, it has Angular >= 2 as a peer dependency.

Usage

Bootstrap the module

import { AirbrakeModule, AirbrakeService } from 'angular-airbrake'
 
NgModule({
    imports: [
        AirbrakeModule.forRoot({
            // Your Airbrake options here, follow the Airbrake documentation
        })
    ],
    providers: [
        { provide: ErrorHandler, useClass: AirbrakeService }
    ]
})
export class MyAngularApp {}
 

Use the service

Let the Angular DI do all the magic for you.

import { Component } from '@angular/core'
import { AirbrakeService } from 'angular-airbrake';
 
@Component(...)
export class MyComponent {
 
    constructor (airbrake: AirbrakeService) {
        airbrake.error('Logging to Airbrake!');
    }
}

Development

We are using Angular CLI to make things a little bearable.

npm install
npm test

Disclaimer

This project is not affiliated in anyway with Airbrake.

Package Sidebar

Install

npm i angular-airbrake

Weekly Downloads

2

Version

0.1.2

License

MIT

Unpacked Size

28.8 kB

Total Files

15

Last publish

Collaborators

  • nextfaze