我使用angular-cli创建了一个全新的Angular4应用程序。之后我使用npm install集成了ng2-webcam。现在,如果我在app.module.ts中添加此ng2-webcam依赖性
import { WebCamComponent } from 'ng2-webcam';
...
@NgModule({
declarations: [
AppComponent,
WebCamComponent
],
....
})
export class AppModule { }
在ng serve
上,它无法编译并抛出以下错误:
Failed to compile.
./~/ng2-webcam/lib/fallback/jscam.swf
Module parse failed: f:\projects\edu\hops\webcam\node_modules\ng2-webcam\lib\fallback\jscam.swf Unexpected character '' (1:3)
You may need an appropriate loader to handle this file type.
(Source code omitted for this binary file)
@ ./~/ng2-webcam/index.ts 4:0-34
@ ./src/app/app.module.ts
@ ./src/main.ts
@ multi webpack-dev-server/client?http://localhost:4200 ./src/main.ts
如果有人帮我解决这个问题,我们将不胜感激?如何包含装载机?