Skip to content

reflect-metadata with an angular rc5 app error localhost/:24 Error: TypeError: Cannot read property 'type' of null(…) #42

Open
@ovione

Description

@ovione

hello Ron,

I was using reflect-metadata 0.1.3 in an angular rc4 app in a project.
Now I use reflect-metadata 0.1.8 and angular rc5.

The way I was using it was the following.

  • systemjs.config.js
    map['reflect-metadata'] = 'node_modules/reflect-metadata/Reflect.js';
  • main.ts
    import "reflect-metadata";

-In my application
`export class MapUtils {

static getClazz(target:any, propertyKey:string):any {
    return Reflect.getMetadata("design:type", target, propertyKey)
}

static getJsonProperty<T>(target:any, propertyKey:string):IJsonMetaData<T> {
    return Reflect.getMetadata(jsonMetadataKey, target, propertyKey);
}`

But now I have the error:
Error: TypeError: Cannot read property 'type' of null(…)

I suspect I'm not mapping properly in the systemjs.config.js but with rc4 and angular rc4 that worked.

If you could guide me into the right direction that would be great

thanks

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions