【发布时间】:2018-03-28 10:42:28
【问题描述】:
由@alexzuza 解决。请参阅下面的答案-大惊小怪!
基本上,从 ng2-opd-popup 文件夹中删除 node_modules 文件夹,然后编辑 src/tsconfig.app.json 以匹配路径。另请参阅 cmets 以获取 rimraf 设置的链接,以自动排除 node_modules 与 npm install 一起安装。
我收到此错误:
错误中的错误遇到静态解析符号值。打电话 函数“makeDecorator”,不支持函数调用。考虑 将函数或 lambda 替换为对导出的引用 功能
找到的解决方案 here 不起作用 - 我正在运行 Angular v. 4.3。
package.json:
PopupModule.forRoot(),
tsconfig.json:
"paths": {
"@angular/*": ["node_modules/@angular/*"]
},
tsconfig.json:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@angular/common": ["../node_modules/@angular/common"],
"@angular/compiler": ["../node_modules/@angular/compiler"],
"@angular/core": ["../node_modules/@angular/core"],
"@angular/forms": ["../node_modules/@angular/forms"],
"@angular/platform-browser": ["../node_modules/@angular/platform-browser"],
"@angular/platform-browser-dynamic": ["../node_modules/@angular/platform-browser-dynamic"],
"@angular/router": ["../node_modules/@angular/router"],
"@angular/http": ["../node_modules/@angular/http"]
},
"lib": [
"es2017",
"dom"
]
}
}
tsconfig.app.json:
{
"compileOnSave": false,
"compilerOptions": {
"baseUrl": ".",
"outDir": "./dist/out-tsc",
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"target": "es5",
"typeRoots": [
"node_modules/@types"
],
"paths": {
"@angular/*": ["../node_modules/@angular/*"]
},
"lib": [
"es2017",
"dom"
]
}
}
我尝试使用的包:ng2-opd-popup
有人对此有解决方案,或者可能有更好的软件包可以使用?
【问题讨论】:
-
不幸的是,问题出在
ng2-opd-popup。您可以手动复制 TypeScript 代码以使用您的项目在本地构建。要修复该模块,他们必须在构建期间从dependencies中删除@angular/*。可能还有其他方法可以修复它,但我不确定。 -
真是太可惜了,这个包裹看起来不错。您对其他模态包有什么建议吗?
标签: json angular typescript npm simplemodal