@loopback/docs
Version:
Documentation for LoopBack 4
36 lines (23 loc) • 1.02 kB
Markdown
---
lang: en
title: 'API docs: core.createservicebinding'
keywords: LoopBack 4.0, LoopBack 4
sidebar: lb4_sidebar
editurl: https://github.com/strongloop/loopback-next/tree/master/packages/core
permalink: /doc/en/lb4/apidocs.core.createservicebinding.html
---
<!-- Do not edit this file. It is automatically generated by API Documenter. -->
[Home](./index.md) > [@loopback/core](./core.md) > [createServiceBinding](./core.createservicebinding.md)
## createServiceBinding() function
Create a service binding from a class or provider
<b>Signature:</b>
```typescript
export declare function createServiceBinding<S>(cls: Constructor<S> | Constructor<Provider<S>>, options?: ServiceOptions): Binding<S>;
```
## Parameters
| Parameter | Type | Description |
| --- | --- | --- |
| cls | <code>Constructor<S> | Constructor<Provider<S>></code> | Service class or provider |
| options | <code>ServiceOptions</code> | Service options |
<b>Returns:</b>
`Binding<S>`