angular-airbrake
v0.1.2
Published
Angular 2+ Service for Airbrake error logging
Downloads
33
Readme
Angular (2+) Airbrake Integration
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.