问题
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