Skip to content

TypeDI dependency injection

wangb edited this page Nov 1, 2018 · 2 revisions
  • Container
    • Container.get -> Containter.getServiceValue -> createIfNotExist -> initializeParams -> applyPropertyHandlers
    • Container.set -> this.services.push
    • Container.registerHandler -> this.handlers.push
  • Service
    • Container.set(service)
    • dependencies = arguments.length === 2 ? optionsOrServiceName as any[] : [];
  • Inject
    • Container.registerHandler
    • will be called in applyPropertyHandlers
  • constructor parameters inject
  • named service/ named inject
Clone this wiki locally