title: Why is my property injection attempt not injecting anything but undefined?
body: <p>I have an existing typescript project using inversify. I have defined a logger in my TYPES at <code>TYPES.ILoggger</code> and when I access the logger directly from my container it works:</p>
  
  <pre><code>import {ILogger} from "./interfaces/ILogger";
  import {TYPES} from "./interfaces/TYPES";
  import container from "./kernel/inversify.config";
  
  const loggerFromTheContainer: ILogger = container.get&lt;ILogger&gt;(TYPES.ILogger);
  loggerFromTheContainer.info("I WILL LOG"); // this works
  </code></pre>
  
  <p>So my setup should be fine.</p>
  
  <p>I don't want to access the container directly but I want to use property injection. [InversifyJS' <a href="https://github.com/inversify/InversifyJS" rel="noreferrer">README</a> provides an example:</p>
  
  <blockquote>
    <p>If you prefer it you can use property injection instead of constructor
    injection so you don't have to declare the class constructor:</p>
  
  <pre><code>@injectable()
  class Ninja implements Warrior {
      @inject(TYPES.Weapon) private _katana: Weapon;
      @inject(TYPES.ThrowableWeapon) private _shuriken: ThrowableWeapon;
      public fight() { return this._katana.hit(); }
      public sneak() { return this._shuriken.throw(); }
  }
  </code></pre>
  </blockquote>
  
  <p>and I try to follow that one.</p>
  
  <p>Yet when I try to inject the logger through property injection, I suddenly get <code>undefined</code> as a logger and I don't know why:</p>
  
  <pre><code>@injectable()
  class ShouldHaveLogger {
      @inject(TYPES.ILogger) private logger: ILogger;
  
      constructor() {
          this.logger.info("Hello World"); // this.logger will remain undefined
      }
  }
  
  new ShouldHaveLogger();
  </code></pre>
  
  <p>It will throw a generic </p>
  
  <pre><code>TypeError: Cannot read property 'info' of undefined
  </code></pre>
  
  <p>as <code>this.logger</code> is not being injected. Yet why and how to fix it?</p>