> ## Documentation Index
> Fetch the complete documentation index at: https://docs.appsignal.com/llms.txt
> Use this file to discover all available pages before exploring further.

# @appsignal/angular

## Installation

### With npm or yarn

Add the `@appsignal/angular` and `@appsignal/javascript` packages to your `package.json`. Then, run `yarn install`/`npm install`.

You can also add these packages to your `package.json` on the command line:

<CodeGroup>
  ```bash Bash theme={null}
  yarn add @appsignal/javascript @appsignal/angular
  npm install @appsignal/javascript @appsignal/angular
  ```
</CodeGroup>

### With JSPM.io import maps

Using the [JSPM.io import map generator](https://generator.jspm.io/), you can generate an import map for your application's dependencies.

Add `@appsignal/javascript` and `@appsignal/angular` to the dependencies list, then add the generated import map and ES module shims to your application's code.

### With `rails-importmap`

Use the following command to add these packages to your Rails application's import maps:

<CodeGroup>
  ```sh Shell theme={null}
  ./bin/importmap pin @appsignal/javascript @appsignal/angular
  ```
</CodeGroup>

## Usage

### `AppsignalErrorHandler`

The default Angular integration is a class that extends the `ErrorHandler` class provided by `@angular/core`. In a new app created using `@angular/cli`, your `app.module.ts` file might include something like this:

<CodeGroup>
  ```js JavaScript theme={null}
  import { ErrorHandler, NgModule } from "@angular/core";
  import { appsignal } from "./appsignal";
  import { createErrorHandlerFactory } from "@appsignal/angular";

  @NgModule({
    // other properties
    providers: [
      {
        provide: ErrorHandler,
        useFactory: createErrorHandlerFactory(appsignal),
      },
    ],
    // other properties
  })
  export class AppModule {}
  ```
</CodeGroup>
