---
id: fast-foundation.servicelocator.getall
title: ServiceLocator.getAll() method
hide_title: true
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[@microsoft/fast-foundation](./fast-foundation.md) &gt; [ServiceLocator](./fast-foundation.servicelocator.md) &gt; [getAll](./fast-foundation.servicelocator.getall.md)

## ServiceLocator.getAll() method

Gets an array of all dependencies by key.

<b>Signature:</b>

```typescript
getAll<K extends Key>(key: K, searchAncestors?: boolean): readonly Resolved<K>[];
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  key | K | The key to lookup. |
|  searchAncestors | boolean | Indicates whether to search the entire hierarchy of service locators. |

<b>Returns:</b>

readonly [Resolved](./fast-foundation.resolved.md)<!-- -->&lt;K&gt;\[\]
