Can you set a static enum inside of a TypeScript class?

To do this, you would need to define it outside of the class first, then assign it as a static property.

enum UNIT_STATUS {
    NOT_STARTED,
    STARTED,
    COMPLETED,
}

class UnitModel extends Backbone.Model {

    static UNIT_STATUS = UNIT_STATUS;

    isComplete(){
        return this.get("status") === UNIT_STATUS.COMPLETED;
    }
}

export = UnitModel;

Leave a Comment

Hata!: SQLSTATE[HY000] [1045] Access denied for user 'divattrend_liink'@'localhost' (using password: YES)