Angular2 DI错误没有EventEmitter的提供者

时间:2017-01-26 17:19:29

标签: angular compilation runtime

当我尝试启动Angular2应用程序时,我在运行时遇到了问题:

  

EXCEPTION:没有EventEmitter的提供者!

     

错误:DI错误       在NoProviderError.ZoneAwareError(localhost / js / polyfills.js:4666:33)       在NoProviderError.BaseError [作为构造函数](localhost / js / vendor.js:11730:16)       在NoProviderError.AbstractProviderError [作为构造函数](localhost / js / vendor.js:77033:16)       在新的NoProviderError(localhost / js / vendor.js:77082:16)       在ReflectiveInjector _。 throwOrNull(localhost / js / vendor.js:123981:19)       在ReflectiveInjector getByKeyDefault(localhost / js / vendor.js:124018:25)       在ReflectiveInjector getByKey(localhost / js / vendor.js:123968:25)       在ReflectiveInjector .get(ocalhost / js / vendor.js:123730:21)       在AppModuleInjector.get(/AppModule/module.ngfactory.js:213:131)       在AppModuleInjector.getInternal(/AppModule/module.ngfactory.js:688:61)       在AppModuleInjector.NgModuleInjector.get(localhost / js / vendor.js:77948:44)       在CompiledTemplate.proxyViewClass.AppView.injectorGet(localhost / js / vendor.js:124739:45)       在CompiledTemplate.proxyViewClass.View_AppComponent_Host0.createInternal   (/AppModule/AppComponent/host.ngfactory.js:15:173)       在CompiledTemplate.proxyViewClass.AppView.createHostView(localhost / js / vendor.js:124695:21)

但我不知道它来自哪里......

这是我的tsconfig:

{
  "compilerOptions": {
    "target": "ES5",
    "module": "commonjs",
    "emitDecoratorMetadata": true,
    "experimentalDecorators": true,
    "sourceMap": true,
    "noEmitHelpers": true,
    // option for momentjs compilation
    "allowSyntheticDefaultImports": true
  },
  "compileOnSave": false,
  "buildOnSave": false,
  "awesomeTypescriptLoaderOptions": {
    "forkChecker": true,
    "useWebpackText": true
  },
  "exclude": [
    "node_modules",
    "dist",
    "src/custom-typings",
    "typings/index.d.ts",
    "typings/globals/core-js/index.d.ts",
    "typings/globals/node/index.d.ts",
    "typings/globals/jasmine/index.d.ts"
  ]
}

我正在使用'awesome-typescript-loader','angular2-template-loader','angular2-router-loader'。

有什么想法吗?

1 个答案:

答案 0 :(得分:2)

我发现了这个问题! Chrome没有显示出良好的信息...... Firefox和IE表明导致SlimLoadingBarService问题的服务。

然后我看到它在github上注册了: https://github.com/akserg/ng2-slim-loading-bar/issues/32

感谢Günter编辑帖子。我下次怎么能自己做?