zazoomauro / node-dependency-injection

The NodeDependencyInjection component allows you to standarize and centralize the way objects are constructed in your application.
https://github.com/zazoomauro/node-dependency-injection/wiki
MIT License
275 stars 34 forks source link

Autowiring with public and protected constructor properties #204

Open zazoomauro opened 1 year ago

zazoomauro commented 1 year ago

At the moment, Autowiring only works with private constructor properties.

Make it working with the following examples:

interface TestInterface {
}

class ExampleClass {
  constructor(protected readonly parameter: TestInterface) {
  }
}

or

interface TestInterface {
}

class ExampleClass {
  private thing: TestInterface;
  constructor(parameter: TestInterface) {
    this.thing = parameter;
  }
}