1
我有一個用RC4編寫的大項目,在將它更新到RC5時有一些問題。Angular 2 RC4到RC5 - 沒有提供ViewContainerRef
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中的版本,然後啓動項目。
任何人都可以指向正確的方向嗎?
檢查官方角2 RC4到RC5遷移文檔。隨意問你是否有什麼不清楚的地方。但是,考慮到這是一個大項目,您可能需要一些時間才能成功完成向RC5的遷移。因此,我強烈建議您閱讀NgModule文檔以瞭解NgModules的工作原理。你可以在這裏找到提到的文檔:https://angular.io/docs/ts/latest/cookbook/rc4-to-rc5.html https://angular.io/docs/ts/latest/guide/ngmodule.html –
通過改變應用程序的框架解決該條款指示 – WilfredMifsud
該鏈接是404。 –