# Integrate in Angular

- Human documentation: [https://docs.univer.ai/guides/sheets/getting-started/integrations/angular](https://docs.univer.ai/guides/sheets/getting-started/integrations/angular)

- Agent Markdown: [https://docs.univer.ai/guides/sheets/getting-started/integrations/angular.md](https://docs.univer.ai/guides/sheets/getting-started/integrations/angular.md)

- Requested language: `en-US`

- Content language: `en-US`

- Documentation version: `1.0.0-rc.0`

- Source: [sheets/getting-started/integrations/angular.mdx](https://github.com/dream-num/documentation/blob/dev/content/guides/sheets/getting-started/integrations/angular.mdx)

---

> [!NOTE]
> If you are looking for how to use Angular components as custom components, please refer to [here](https://docs.univer.ai/guides/sheets/ui/components.md#angular).

Before integrating Univer into an Angular project, read [installation and basic usage](https://docs.univer.ai/guides/sheets/getting-started/installation.md) and familiarize yourself with Angular components and lifecycle hooks.

### Integration Steps

1. Initialize Univer in `ngAfterViewInit`.
2. Dispose of Univer in `ngOnDestroy`.

### Example

```typescript
import type { AfterViewInit, ElementRef, OnDestroy } from '@angular/core'
import type { Univer } from '@univerjs/presets'
import { Component, ViewChild } from '@angular/core'
import { UniverSheetsCorePreset } from '@univerjs/preset-sheets-core'
import UniverPresetSheetsCoreenUS from '@univerjs/preset-sheets-core/locales/en-US'
import { createUniver, LocaleType, mergeLocales } from '@univerjs/presets'

import '@univerjs/preset-sheets-core/lib/index.css'

@Component({
  selector: 'app-univer',
  standalone: true,
  template: '<div #container style="height: 600px"></div>',
})
export class UniverComponent implements AfterViewInit, OnDestroy {
  @ViewChild('container') container!: ElementRef<HTMLDivElement>

  private univer?: Univer

  ngAfterViewInit() {
    const { univer, univerAPI } = createUniver({
      locale: LocaleType.EN_US,
      locales: {
        [LocaleType.EN_US]: mergeLocales(
          UniverPresetSheetsCoreenUS,
        ),
      },
      presets: [
        UniverSheetsCorePreset({
          container: this.container.nativeElement,
        }),
      ],
    })

    this.univer = univer
    univerAPI.createWorkbook({})
  }

  ngOnDestroy() {
    this.univer?.dispose()
  }
}
```
