---
lang: en
title: 'API docs: repository.repositorymixindoc.component'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
permalink: /doc/en/lb4/apidocs.repository.repositorymixindoc.component.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/repository](./repository.md) &gt; [RepositoryMixinDoc](./repository.repositorymixindoc.md) &gt; [component](./repository.repositorymixindoc.component.md)

## RepositoryMixinDoc.component() method

Add a component to this application. Also mounts all the components repositories.

<b>Signature:</b>

```typescript
component(component: Class<{}>): Binding;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  component | <code>Class&lt;{}&gt;</code> | The component to add. |

<b>Returns:</b>

`Binding`

## Example


```ts

export class ProductComponent {
  controllers = [ProductController];
  repositories = [ProductRepo, UserRepo];
  providers = {
    [AUTHENTICATION_STRATEGY]: AuthStrategy,
    [AUTHORIZATION_ROLE]: Role,
  };
};

app.component(ProductComponent);

```


