0
enum型をパラメータとしてデコレータ関数に渡すことはできますか?Typescript:デコレータパラメータとしてのenum型
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; // type is undefined
},
}
};
}
ここでの型は常に定義されていません。
多くのthx、これは役立ちます –