[英]angular4-carousel not working with angular 5
我正在尝试在我的angular 5项目(angular4-carousel)中使用一个滑块,但是正如我提到的那样,它会引发抛出错误,我尝试使用ngx-carousel,但是那也无法正常工作。
./node_modules/angular4-carousel/index.ts中的错误模块构建失败:错误:D:\\ Workspace \\ ntwine \\ node_modules \\ angular4-carousel \\ index.ts不属于编译输出的一部分。 请检查其他错误消息以获取详细信息。 在plugin.done处的AngularCompilerPlugin.getCompiledFile(D:\\ Workspace \\ ntwine \\ node_modules \\ @ngtools \\ webpack \\ src \\ angular_compiler_plugin.js:649:23)处,然后(D:\\ Workspace \\ ntwine \\ node_modules \\ @ngtools \\ webpack \\ src \\ loader.js:467:39)在process._tickCallback(内部/进程/next_tick.js:103:7)@ ./src/app/app.module.ts 12:0-51 @ ./src/main .ts @多webpack-dev-server / client? http://0.0.0.0:0 ./src/main.ts
为什么会出现此错误?
通过将以下行添加到src目录下的tsconfig.app.json文件中,我能够解决此问题并使其正常工作。
, //I added this section to fix the compile error
"include": [
"node_modules/angular4-carousel/index.ts"
]
这是我在src目录下编辑的 tsconfig.app.json文件。
{
"compilerOptions": {
"sourceMap": true,
"declaration": false,
"moduleResolution": "node",
"emitDecoratorMetadata": true,
"experimentalDecorators": true,
"lib": [
"es2016",
"dom"
],
"outDir": "../out-tsc/app",
"target": "es5",
"module": "es2015",
"baseUrl": "",
"types": []
},
"exclude": [
"test.ts",
"**/*.spec.ts"
]
, //I added this section to fix the compile error, must pass the adject path of index.ts file
"include": [
"../node_modules/angular4-carousel/index.ts"
]
}
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.