Skip to content

Latest commit

 

History

History
43 lines (35 loc) · 1.83 KB

reserved-binding-keys.md

File metadata and controls

43 lines (35 loc) · 1.83 KB
lang title keywords toc_level sidebar permalink
en
Reserved binding keys
LoopBack 4.0, LoopBack 4, Node.js, TypeScript, OpenAPI
1
lb4_sidebar
/doc/en/lb4/Reserved-binding-keys.html

When using dependency injection there are a few things to keep in mind with regards to binding keys.

Different packages and components for LoopBack 4 may have some bindings already defined. You can change the default behavior by overriding the default binding, but you must ensure the interface of the new binding is the same as the default (but behavior can be different).

It is recommended to use the CONSTANT defined for each binding key in it's respective namespace. You can import a namespace and access the binding key in your application as follows:

import {BindingKeyNameSpace} from 'package-name';

app.bind(BindKeyNameSpace.KeyName).to('value');

Following is a list of links to the apidocs on the binding keys in use by various @loopback packages:

{% include note.html title="Declaring new binding keys" content=" For component developers creating a new Binding, to avoid conflict with other packages, it is recommended that the binding key start with the package name as the prefix. Example: @loopback/authentication component uses the prefix authentication for its binding keys. " %}