Skip to content

angular-cli does build project when using Reflect.getMetadata #1495

Closed
@fkolar

Description

@fkolar

Please provide us with the following information:

  1. OS? Windows 7, 8 or 10. Linux (which distribution). Mac OSX (Yosemite? El Capitan?)
    Mac Osx
  2. Versions. Please run ng --version. If there's nothing outputted, please run
    in a Terminal: node --version and paste the result here:
    angular-cli: 1.0.0-beta.10
    node: 6.0.0
    os: darwin x64
  3. Repro steps. Was this an app that wasn't created using the CLI? What change did you
    do on your code? etc.

I created simple decorator in my component class

export function Test() {
    return function (target: Object, key: string) {
        var t = Reflect.getMetadata("design:type", target, key);
        console.log(`${key} type: ${t.name}`);

    }
}

When I try to compile this using angular cli
ng build --dev

I get following error :

 Property 'getMetadata' does not exist on type 'typeof Reflect'.

When I try to compile the TS file just using tsc, it work fine.

am I missing something in terms of configuring angular-cli for use of Reflect API?

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions