Page Contents

Overview

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: