Angular 2 RC4到RC5 - 没有ViewContainerRef的提供者

时间:2016-08-25 08:52:26

标签: angular

我有一个用RC4编写的大项目,并在将其更新为RC5时遇到一些问题。

zone.js:484Unhandled Promise rejection: No provider for ViewContainerRef! ; Zone: <root> ; Task: Promise.then ; Value: NoProviderError {message: "No provider for ViewContainerRef!", stack: "Error: DI Exception↵    at NoProviderError.BaseExc…ost:3000/vendor.js?3a298925c7ec72a2d72b:13238:19)", keys: Array[1], injectors: Array[1]} Error: DI Exception
    at NoProviderError.BaseException [as constructor] (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:4821:24)
    at NoProviderError.AbstractProviderError [as constructor] (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:6355:17)
    at new NoProviderError (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:6392:17)
    at ReflectiveInjector_._throwOrNull (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:6255:20)
    at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:6283:26)
    at ReflectiveInjector_._getByKey (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:6246:26)
    at ReflectiveInjector_.get (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:6055:22)
    at NgModuleInjector.DynamicModuleInjector.createInternal (DynamicModule.ngfactory.js:295:87)
    at NgModuleInjector.create (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:13254:77)
    at NgModuleFactory.create (http://localhost:3000/vendor.js?3a298925c7ec72a2d72b:13238:19)consoleError @ zone.js:484_loop_1 @ zone.js:511drainMicroTaskQueue @ zone.js:515
zone.js:486Error: Uncaught (in promise): No provider for ViewContainerRef!(…)

我所做的就是升级package.json中的版本,然后启动项目。

有人能指出我正确的方向吗?

1 个答案:

答案 0 :(得分:-3)

根据
改变了应用骨架 https://angular.io/docs/ts/latest/cookbook/rc4-to-rc5.html

并且有效