簡體   English   中英

angular4-carousel無法與angular 5一起使用

[英]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.

 
粵ICP備18138465號  © 2020-2024 STACKOOM.COM