Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Resolve and Inject value parameter needs to be optional for static class methods #155

Open
linnenschmidt opened this issue Mar 8, 2016 · 0 comments

Comments

@linnenschmidt
Copy link

In Typescript for static class methods, there is an error with the value property of the defineProperty descriptor.

@Component({
  selector: 'my-component',
  template: 'template'
})
@Inject('resolveSomething', MyService)
export class MyComponent {

  @Resolve()
  @Inject(MyService)
  static resolveSomething(MyService: MyService) {
    return MyService.getSomething();
  }
}

Argument of type 'TypedPropertyDescriptor<(MyService: MyService) => any>' is not assignable to parameter of type '{ value: any; }'.
Property 'value' is optional in type 'TypedPropertyDescriptor<(MyService: MyService) => any>' but required in type '{ value: any; }'.

Here ist the optional value of the TypedPropertyDescriptor: https://github.com/Microsoft/TypeScript/blob/727b9/src/lib/core.d.ts#L1245

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant