如何使用typescript在类中创建枚举属性?

时间:2016-05-27 10:01:46

标签: typescript

enum TYPES{
   signin,
   signup
}

import {TYPES} from 'filename'

class A{
   _types : TYPES = TYPES; //typescript is throwing error
}

1 个答案:

答案 0 :(得分:0)

class A{
   _types : typeof TYPES = TYPES;
}