# Integrations ## AngularJS To track AngularJS errors you need to override original error handler like this ```javascript import angular from 'angular'; export default angular.module('exceptionOverride', []).factory('$exceptionHandler', function () { return function (exception) { const $log = angular.injector(['ng']).get('$log'); Djaty.trackBug(exception); $log.error(exception) }; }); ``` Then add this module to your AngularJS dependencies ```javascript angular.module('app', ['exceptionOverride', /* Your dependencies... */]) ``` ```html My Website ``` ## Angular 2+ [Include **`djaty-javascript.js`** file](./installation.md#import-and-set-the-api-key) and configure Angular [Error Handler](https://angular.io/api/core/ErrorHandler) to properly track Angular 2+ application. If you already have a custom `ErrorHandler` class, just include `Djaty.trackBug(err.originalError || err);` into the `handleError()` method. ```typescript import { BrowserModule } from '@angular/platform-browser'; import { NgModule, ErrorHandler, Injectable } from '@angular/core'; import { AppComponent } from './app.component'; declare const Djaty: {trackBug: (err: Error) => void}; export class DjatyErrorHandler implements ErrorHandler { handleError(err: {originalError: Error} | Error): void { const error = err.originalError || err; if (error instanceof Error) { Djaty.trackBug(error); } else { // Errors like 5xx (Already reported if Ajax tracking is enabled), 4xx and others. } throw err; } } @NgModule({ declarations: [AppComponent], imports: [BrowserModule], providers: [{ provide: ErrorHandler, useClass: DjatyErrorHandler }], bootstrap: [AppComponent], }) class AppModule { } ```