---
lang: en
title: 'API docs: context.binding.toalias'
keywords: LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
sidebar: lb4_sidebar
editurl: https://github.com/loopbackio/loopback-next/tree/master/packages/context
permalink: /doc/en/lb4/apidocs.context.binding.toalias.html
---

<!-- Do not edit this file. It is automatically generated by API Documenter. -->

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [Binding](./context.binding.md) &gt; [toAlias](./context.binding.toalias.md)

## Binding.toAlias() method

Bind the key to an alias of another binding

**Signature:**

```typescript
toAlias(keyWithPath: BindingAddress<T>): this;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  keyWithPath | [BindingAddress](./context.bindingaddress.md)<!-- -->&lt;T&gt; | Target binding key with optional path, such as <code>servers.RestServer.options#apiExplorer</code> |

**Returns:**

this


