Could an enum type be passed as a parameter to a decorator function?
export class A {
@AsEnum(SomeEnum)
name: string;
}
export enum SomeEnum { A, B, C}
export function AsEnum(type): any {
return (target, propert) => {
return {
get: function(): Object {
return type; // the value of type remains undefined
},
}
};
}
The value of 'type' is consistently undefined in this scenario.