角度:ts-nameof 通过 ts-patch

问题描述

我正在尝试将 https://github.com/dsherret/ts-nameofhttps://github.com/nonara/ts-patch 一起使用。安装过程中没有错误,但编译时出现错误 Cannot find name 'nameof'

有没有人在 Angular >= 8 中使用过 nameof 的库?

我需要枚举(相当于 C# 中的 Flags):

export enum SimpleEnum {
    One = 1 << 0,// 1
    Two = 1 << 1,// 2
    Three = 1 << 2,// 4
}

做这样的事情:

const txt = nameof(SimpleEnum);

并接收

txt = "SimpleEnum"

解决方法

暂无找到可以解决该程序问题的有效方法,小编努力寻找整理中!

如果你已经找到好的解决方法,欢迎将解决方案带上本链接一起发送给小编。

小编邮箱:dio#foxmail.com (将#修改为@)