MCPcopy Index your code
hub / github.com/loopbackio/loopback-next / toInjectable

Method toInjectable

packages/context/src/binding.ts:918–923  ·  view source on GitHub ↗

* Bind to a class optionally decorated with `@injectable`. Based on the * introspection of the class, it calls `toClass/toProvider/toDynamicValue` * internally. The current binding key will be preserved (not being overridden * by the key inferred from the class or options). * * This i

(
    ctor: DynamicValueProviderClass<T> | Constructor<T | Provider<T>>,
  )

Source from the content-addressed store, hash-verified

916 * @param ctor - A class decorated with `@injectable`.
917 */
918 toInjectable(
919 ctor: DynamicValueProviderClass<T> | Constructor<T | Provider<T>>,
920 ) {
921 this.apply(bindingTemplateFor(ctor));
922 return this;
923 }
924
925 /**
926 * Bind the key to an alias of another binding

Callers 3

lifecycle.unit.tsFile · 0.80
binding.unit.tsFile · 0.80

Calls 2

applyMethod · 0.95
bindingTemplateForFunction · 0.90

Tested by

no test coverage detected