11.0.0-beta.3 • Published 3 years ago

@public-js/ng-catcher v11.0.0-beta.3

Weekly downloads
-
License
MIT
Repository
github
Last release
3 years ago

@public-js/ng-catcher

CI Version License

Codacy Badge Language grade: JavaScript codecov Maintainability


NgCatcher provides a comfortable way to catch errors in Angular apps.

Getting Started

Add NgCatcher to your project by running:

npm i @public-js/ng-catcher

Then set it up in the app.module.ts. Here's the minimal config:

import { HttpClientModule } from '@angular/common/http';
import { BrowserModule } from '@angular/platform-browser';
import { NgCatcherConfigService, NgCatcherModule } from '@public-js/ng-catcher';

const ngCatcherConfig = (cs: NgCatcherConfigService): () => void => () =>
    cs.setConfig({
        serviceUrl: '',
        project: '',
        version: '',
    });

@NgModule({
    // declarations: [...],
    imports: [
        BrowserModule,
        HttpClientModule,
        NgCatcherModule,
        // ...
    ],
    providers: [
        {
            provide: APP_INITIALIZER,
            multi: true,
            deps: [NgCatcherConfigService],
            useFactory: ngCatcherConfig,
        },
        // ...
    ],
    // bootstrap: [...],
})
export class AppModule {
}

If you experience any troubles with the initial configuration, you may refer to the src/app/app/module.ts file within this repo.