当我运行angular应用程序时,出现以下错误。前端有角度,后端使用弹簧。
build.js:1 **EXCEPTION: Uncaught (in promise): Error: No provider for t!
Error: No provider for t!**
at e [as constructor] (http://localhost:8080/xo-as/ng/build.js:1:59315)
at e [as constructor] (http://localhost:8080/xo-as/ng/build.js:1:60416)
at new e (http://localhost:8080/xo-as/ng/build.js:1:60744)
at t._throwOrNull (http://localhost:8080/xo-as/ng/build.js:1:71064)
at t._getByKeyDefault (http://localhost:8080/xo-as/ng/build.js:1:71402)
at t._getByKey (http://localhost:8080/xo-as/ng/build.js:1:70782)
at t.get (http://localhost:8080/xo-as/ng/build.js:1:69150)
at e.get (http://localhost:8080/xo-as/ng/build.js:1:126499)
at e.t.injectorGet (http://localhost:8080/xo-as/ng/build.js:1:152798)
at e.get (
在下面的链接中,他们也提出了一些解决方案。
https://github.com/salemdar/angular2-cookie/issues/37
我尝试了以下方法:
import { CookieService } from 'angular2-cookie/services/cookies.service';
import { CookieService, CookieOptions } from 'angular2-cookie/core';
我该怎么做才能正确导入它?
如果我需要提供任何其他信息,请告诉我?
编辑:
我现在可以使用以下工具导入CookieOptions
import { CookieService, CookieOptions } from 'ngx-cookie';
但是当我运行应用程序的时候,我还是会出错
Error: No provider for t! at e [as constructor]