Options
All
  • Public
  • Public/Protected
  • All
Menu

The IoC Container class. Can be used to register and to retrieve your dependencies. You can also use de decorators AutoWired, Scoped, Singleton, Provided and Provides to configure the dependency directly on the class.

Hierarchy

  • Container

Index

Methods

Methods

Static bind

  • bind(source: Function): Config
  • Add a dependency to the Container. If this type is already present, just return its associated configuration object. Example of usage:

    Container.bind(PersonDAO).to(ProgrammerDAO).scope(Scope.Singleton);
    

    Parameters

    • source: Function

      The type that will be bound to the Container

    Returns Config

    a container configuration

Static get

  • get(source: Function): any
  • Retrieve an object from the container. It will resolve all dependencies and apply any type replacement before return the object. If there is no declared dependency to the given source type, an implicity bind is performed to this type.

    Parameters

    • source: Function

      The dependency type to resolve

    Returns any

    an object resolved for the given source type;

Generated using TypeDoc