Skip to content

Function instead of interface name when using Reflect #10711

Closed
@pooyaho

Description

@pooyaho

Hi
I've a problem with using reflect in field decorators. I've created a decorator with below signature:

export function Inject() {
    return function (clazz, name) {
        .......
        let typeName: string = Reflect.getOwnMetadata("design:type", clazz, name).name;
        .........
    }
}

class MyClass{
    @Inject()
    private $q:ng.IQService
}

And I use @Inject on fields. It works when field type is class but when field type is interface, it returns Function not the name of interface. How can I fix it?

Metadata

Metadata

Assignees

No one assigned

    Labels

    QuestionAn issue which isn't directly actionable in code

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions