Skip to content

Invalid @Inject Decorator declaration on property #68

Open
@jhd-lego

Description

@jhd-lego

I seem to be hitting an error when I am trying to inject a property on my class.

export class ADFSRepository extends AuthFacade {
  @Inject
  private readonly dataSource: ADALDataSource
}

The injected value is bound, it is an abstract class, and it works perfectly fine if I force the Inject declaration to always go to the property declaration here

if (args.length === 2 || (args.length === 3 && typeof args[2] === 'undefined')) {
return InjectPropertyDecorator.apply(this, args);

The issue seems to be that my args is an array of length 3, where the third argument is an object.

0: AuthFacade {constructor: ƒ, signInWithUsername: ƒ}
1: "dataSource"
2: {configurable: true, enumerable: true, writable: true, initializer: null}
length: 3

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions