我试图枚举映射到一个字符串: enum Status {
NEW = "NEW",
INPROCESSING = "IN PROCESSING",
DONE = "DONE"
};
const statusToColor: { [key in Status ]: string } = {
"NEW": "blue",
"IN PROCESSI
以下锈病代码无法编译: enum Foo {
Bar,
}
impl Foo {
fn f() -> Self {
Self::Bar
}
}
错误信息混淆了我: error[E0599]: no associated item named `Bar` found for type `Foo` in the current scope
-->
有谁知道是否可以在Angular模块中导出枚举? 如果没有,有没有在Angular模块中发布枚举的最佳实践? // not working example
// i dont know how to export GreatEnum
import { NgModule } from '@angular/core';
import { CommonModule } from '@angula