Holen Sie sich den Schlüssel des Enum -Typscripts
let enums = Object.keys(SomeEnum).filter(x => x === yourValue));
Lazy Lizard
let enums = Object.keys(SomeEnum).filter(x => x === yourValue));
let enums = Object.keys(SomeEnum).filter(x => !(parseInt(x) >= 0));
console.log("Enums", enums); //Enums: A, B, C, D
function getEnumKeys(enumParam: any) {
return Object.keys(enumParam).filter((item) => {
return item;
});
}