我在使用“fhir”类型库时遇到问题
https://www.npmjs.com/package/@types/fhir
我有两个不同的角度应用程序,其中一个程序库已安装(通过NPM)并添加到tsconfig.app.json文件中。
"types": [
"hammerjs",
"fhir"
],
此应用程序工作正常,我可以使用诸如
orgData: fhir.Organization[] = [];
此后,我创建了第二个Angular应用程序,并尝试应用安装类型库的相同过程,将引用添加到tsconfig.app.json文件中。
但是,对于第二个应用程序,我得到一个错误
Cannot use namespace 'fhir' as a value.
据我所见,我有一个与第一个应用程序相同的设置,尽管很明显,我一定错过了一些东西,因为它不起作用。
我注意到这里提出的问题
How do I use @types/fhir in angular cli project
但正如我所说,我有一个项目工作得很好,没有使用上面描述的方法。
有什么线索可以告诉我这里可能缺少什么吗?
tsconfig.app.json文件如下
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"declaration": false,
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"allowJs": true,
"lib": ["es2016", "dom"],
"module": "es2015",
"moduleResolution": "node",
"outDir": "../dist/out-tsc",
"sourceMap": true,
"target": "es5",
"typeRoots": [
"../node_modules/@types"
],
"types": [
"hammerjs",
"fhir"
],
"noUnusedParameters": false,
"noUnusedLocals": false,
"allowUnreachableCode": false,
"pretty": true
},
"exclude": [
"test.ts",
"**/*.spec.*"
]
}