---
lang: en
title: 'API docs: context.binding.toalias'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
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

<b>Signature:</b>

```typescript
toAlias(keyWithPath: BindingAddress<T>): this;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  keyWithPath | <code>BindingAddress&lt;T&gt;</code> | Target binding key with optional path, such as <code>servers.RestServer.options#apiExplorer</code> |

<b>Returns:</b>

`this`


