错误没有e

时间:2017-10-27 03:24:31

标签: angular

我不明白这个错误。只有当我点击一个有/adminsection路由器的链接时才会发生这种情况。这工作正常,但现在它无法正常工作。

  

vendor.5593a633d149efa93b2d.bundle.js:1错误错误:未捕获(在   承诺):错误:没有e的提供者!错误:没有e的提供者!       在E(vendor.5593a633d149efa93b2d.bundle.js:1)       在O(vendor.5593a633d149efa93b2d.bundle.js:1)       at t._throwOrNull(vendor.5593a633d149efa93b2d.bundle.js:1)       at t._getByKeyDefault(vendor.5593a633d149efa93b2d.bundle.js:1)       at t._getByKey(vendor.5593a633d149efa93b2d.bundle.js:1)       at t.get(vendor.5593a633d149efa93b2d.bundle.js:1)       在Be(vendor.5593a633d149efa93b2d.bundle.js:1)       at t.get(vendor.5593a633d149efa93b2d.bundle.js:1)       在An(vendor.5593a633d149efa93b2d.bundle.js:1)       在En(vendor.5593a633d149efa93b2d.bundle.js:1)       在E(vendor.5593a633d149efa93b2d.bundle.js:1)       在O(vendor.5593a633d149efa93b2d.bundle.js:1)       at t._throwOrNull(vendor.5593a633d149efa93b2d.bundle.js:1)       at t._getByKeyDefault(vendor.5593a633d149efa93b2d.bundle.js:1)       at t._getByKey(vendor.5593a633d149efa93b2d.bundle.js:1)       at t.get(vendor.5593a633d149efa93b2d.bundle.js:1)       在Be(vendor.5593a633d149efa93b2d.bundle.js:1)       at t.get(vendor.5593a633d149efa93b2d.bundle.js:1)       在An(vendor.5593a633d149efa93b2d.bundle.js:1)       在En(vendor.5593a633d149efa93b2d.bundle.js:1)       在你(polyfills.67d068662b88f84493d2.bundle.js:格式化:2544)       在你(polyfills.67d068662b88f84493d2.bundle.js:格式化:2525)       在polyfills.67d068662b88f84493d2.bundle.js:格式化:2578       在e.invokeTask(polyfills.67d068662b88f84493d2.bundle.js:格式:2342)       at Object.onInvokeTask(vendor.5593a633d149efa93b2d.bundle.js:1)       在e.invokeTask(polyfills.67d068662b88f84493d2.bundle.js:格式:2342)       在r.runTask(polyfills.67d068662b88f84493d2.bundle.js:格式:2169)       在o(polyfills.67d068662b88f84493d2.bundle.js:格式:2007)       at t.invokeTask [as invoke](polyfills.67d068662b88f84493d2.bundle.js:formatted:2407)       在h(polyfills.67d068662b88f84493d2.bundle.js:格式:1416)

1 个答案:

答案 0 :(得分:1)

以前我遇到过同样的问题。我用以下方法解决了这个问题。我改变了,

import { CookieService } from 'angular2-cookie/services/cookies.service';

import { CookieService, CookieOptions } from 'angular2-cookie/core';

最后通过提供一个值(添加NgModule中的提供者列表)为CookieOptions提供默认值:

{ provide: CookieOptions, useValue: {} }

如需更多参考,请查看以下git hub问题链接。

https://github.com/salemdar/angular2-cookie/issues/37