typescript string to enum key code example
Example: typescript string to enum
enum Day {
BeforeNoon = "AM",
AfterNoon = "PM"
}
var beforeNoon : string = "AM";
var enumValue : Day = (<any>Day)[beforeNoon];
enum Day {
BeforeNoon = "AM",
AfterNoon = "PM"
}
var beforeNoon : string = "AM";
var enumValue : Day = (<any>Day)[beforeNoon];