Trying to use ts-nameof in Angular project via ts-patch

。_饼干妹妹 提交于 2021-02-19 05:24:12

问题


I'm using Angular 8.2 and installed ts-nameof 4.2.2 for my project and ts-patch 1.0.5 globally.

I ran ts-patch install and ts-patch check shows:

Checking TypeScript v3.5.3 installation in [...]
[+] tsc.js is patched with ts-patch version 1.0.5.
[+] tsserverlibrary.js is patched with ts-patch version 1.0.5.
[+] typescript.js is patched with ts-patch version 1.0.5.
[+] typescriptServices.js is patched with ts-patch version 1.0.5.

So I added the following from the ts-patch examples section to my tsconfig.json:

{
  "compilerOptions": {
    "plugins": [
      { "transform": "ts-nameof", "type": "raw" }
    ]
  }
}

and ran ng serve -o.

It's still complaining about Cannot find name 'nameof'..

I don't see any additonal steps listed, so what am I doing wrong?

来源:https://stackoverflow.com/questions/59937480/trying-to-use-ts-nameof-in-angular-project-via-ts-patch

易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!