Skip to content

Property key in ParameterDecorator is always undefined #15904

@cmargulhano

Description

@cmargulhano

TypeScript Version: 2.3.2

Code

//Here is my code:
.
.
.
    constructor(
        @InputType({
            name : 'Id',
            type : 'text',
            readOnly : true,
            disabled : true,
            width : '300px',
            order : 1,
            tableColumn : 0,
            sortable : true
        })    
        public id? : number) {
    }
.
.
.

//Here is my decorator
.
.
.
export function InputType(parameters : any) {
    function actualDecorator(target: any, property: string | symbol, parameterIndex?: number): void {
        console.log(property);
.
.
.

I was hoping to get the property name, but the property is undefined.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Domain: DecoratorsThe issue relates to the decorator syntaxRevisitAn issue worth coming back to

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions