---
id: fast-foundation.container.registerfactory
title: Container.registerFactory() method
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-foundation](./fast-foundation.md) &gt; [Container](./fast-foundation.container.md) &gt; [registerFactory](./fast-foundation.container.registerfactory.md)

## Container.registerFactory() method

Registers a factory with the container for the specified key.

<b>Signature:</b>

```typescript
registerFactory<T extends Constructable>(key: T, factory: Factory<T>): void;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | T | The key to register the factory under. |
|  factory | [Factory](./fast-foundation.factory.md)<!-- -->&lt;T&gt; | The factory to register. |

<b>Returns:</b>

void
