Skip to content

Added support for injecting the injector

Compare
Choose a tag to compare
@mattias800 mattias800 released this 19 Jan 17:10
· 7 commits to master since this release

If you for some reason need the injector to manually get instances (for example for conditional instantiation), you can now inject it just like any other object.

import {Inject, Injector, Singleton} from "diskajs";

@Inject(Injector)
@Singleton()
export default class ClassWithInjector {

  injector:Injector;

  constructor(injector:Injector) {
    this.injector = injector;  
  }

}