Giter Site home page Giter Site logo

marrbo / environment Goto Github PK

View Code? Open in Web Editor NEW
1.0 2.0 0.0 1.43 MB

Environment manager for Angular projects

Home Page: https://www.npmjs.com/package/@3go/environment

TypeScript 78.46% HTML 2.30% CSS 0.71% JavaScript 18.52%
environment environment-variables environment-configuration environment-manager angular5 angular6 json-to-environment

environment's People

Contributors

ayslanjohnson avatar

Stargazers

 avatar

Watchers

 avatar  avatar

environment's Issues

Setup Airbrake for your Angular application

Install Airbrake for Angular and TypeScript in three easy steps

Step 1: Add the library
Include via CDN:

<script src="https://cdnjs.cloudflare.com/ajax/libs/airbrake-js/1.1.1/client.min.js"></script>

We also support installation via npm or Bower.

Step 2: Create an error handler

The second step is to create an error handler with an AirbrakeClient initialized with your projectId and projectKey. In this example the handler will be in a file called error_handler.ts.

(You can find your project ID and API KEY with your project's settings):

import { ErrorHandler } from '@angular/core';
import AirbrakeClient from 'airbrake-js';

export class AirbrakeErrorHandler implements ErrorHandler {
  airbrake: AirbrakeClient;

  constructor() {
    this.airbrake = new AirbrakeClient({
      projectId: <Your project ID>,
      projectKey: '<Your project API Key>'
    });
  }

  handleError(error: any): void {
    this.airbrake.notify(error);
  }
}

Step 3: Add the error handler to your AppModule

The last step is adding the ErrorHandler to your AppModule, then your app will be ready to report errors to Airbrake.

import { BrowserModule } from '@angular/platform-browser';
import { NgModule, ErrorHandler } from '@angular/core';

import { AppComponent } from './app.component';
import { AirbrakeErrorHandler } from './error_handler';

@NgModule({
  declarations: [
    AppComponent
  ],
  imports: [
    BrowserModule
  ],
  providers: [{provide: ErrorHandler, useClass: AirbrakeErrorHandler}],
  bootstrap: [AppComponent]
})
export class AppModule { }

Visit our official GitHub repo for more configuration options and an example for Angular apps.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.