---
lang: en
title: 'API docs: context.bindingtemplatefor'
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.bindingtemplatefor.html
---

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

[Home](./index.md) &gt; [@loopback/context](./context.md) &gt; [bindingTemplateFor](./context.bindingtemplatefor.md)

## bindingTemplateFor() function

Get the binding template for a class with binding metadata

<b>Signature:</b>

```typescript
export declare function bindingTemplateFor<T>(cls: Constructor<T | Provider<T>> | DynamicValueProviderClass<T>, options?: BindingFromClassOptions): BindingTemplate<T>;
```

## Parameters

|  Parameter | Type | Description |
|  --- | --- | --- |
|  cls | [Constructor](./context.constructor.md)<!-- -->&lt;T \| [Provider](./context.provider.md)<!-- -->&lt;T&gt;&gt; \| [DynamicValueProviderClass](./context.dynamicvalueproviderclass.md)<!-- -->&lt;T&gt; | A class with optional <code>@injectable</code> |
|  options | [BindingFromClassOptions](./context.bindingfromclassoptions.md) | <i>(Optional)</i> |

<b>Returns:</b>

[BindingTemplate](./context.bindingtemplate.md)<!-- -->&lt;T&gt;


