> For the complete documentation index, see [llms.txt](https://k3nsei.gitbook.io/ng-in-viewport/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://k3nsei.gitbook.io/ng-in-viewport/getting-started/import-the-modules.md).

# Import the modules

&#x20;Import the **`InViewportModule`** for each component you want to use:

{% code title="/src/app/app.module.ts" %}

```typescript
import { NgModule } from '@angular/core';
import { BrowserModule } from '@angular/platform-browser';
import { InViewportModule } from 'ng-in-viewport';

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

@NgModule({
    imports: [
        BrowserModule,
        InViewportModule
    ],
    declarations: [AppComponent],
    bootstrap: [AppComponent]
})
export class AppModule {}
```

{% endcode %}

If you want to support legacy browsers like for example ***IE11*** you need to install and load **`IntersectionObserver`** polyfill to your **`src/polyfills.ts`** file:

```
$ yarn add intersection-observer
```

```
$ npm install --save intersection-observer
```

{% code title="/src/polyfills.ts" %}

```typescript
import 'intersection-observer';
```

{% endcode %}
