-
Notifications
You must be signed in to change notification settings - Fork 13.2k
Closed
Labels
DuplicateAn existing issue was already createdAn existing issue was already created
Description
TS 2.6.2
Runtime environment: node.js 8.9.0, current Browsers
I'm trying to decorate a constructor parameter with a decorator like this:
export function inject<T>(key?: string | ClassInterface<T> | undefined) {
...
return function (target: Object, propertyKey: string | symbol, paramInx: number): any {
...
}
}
Expected behaviour: "propertyKey" should be defined
Actual: It is undefined
I know that this is similar to #15904. The point there is that this feature depends on the ES property declaration proposal. But I would like to reiterate that:
- At the moment there is no way of attaining the parameter names of ctors.
- This would make various dependcy injection scenarios much easier.
- The transpiler is the only place to get ahold of this design time information. There are no good work-arounds.
- Even if it is not yet defined in the ES6 proposal: Isn't that what TS is about? Bringing new, useful features to the table and eventually - as ES supports them - transpile them to ES?
Thanks a lot
Metadata
Metadata
Assignees
Labels
DuplicateAn existing issue was already createdAn existing issue was already created