将我的angular2 beta应用程序升级到RC1版本后,我的浏览器控制台日志中出现以下错误:
EXCEPTION: Error in :0:0
browser_adapter.ts:78 EXCEPTION: Error in :0:0BrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335ApplicationRef_.bootstrap @ application_ref.ts:357(anonymous function) @ application_ref.ts:105ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 ORIGINAL EXCEPTION: No provider for Router!BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:65(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335ApplicationRef_.bootstrap @ application_ref.ts:357(anonymous function) @ application_ref.ts:105ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 ORIGINAL STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:69(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335ApplicationRef_.bootstrap @ application_ref.ts:357(anonymous function) @ application_ref.ts:105ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 Error: DI Exception
at NoProviderError.BaseException [as constructor] (exceptions.ts:14)
at NoProviderError.AbstractProviderError [as constructor] (reflective_exceptions.ts:53)
at new NoProviderError (reflective_exceptions.ts:85)
at ReflectiveInjector_._throwOrNull (reflective_injector.ts:844)
at ReflectiveInjector_._getByKeyDefault (reflective_injector.ts:873)
at ReflectiveInjector_._getByKey (reflective_injector.ts:835)
at ReflectiveInjector_.get (reflective_injector.ts:632)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:15)
at DebugAppView.AppView.create (view.ts:110)
at DebugAppView.create (view.ts:315)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:70(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335ApplicationRef_.bootstrap @ application_ref.ts:357(anonymous function) @ application_ref.ts:105ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 ERROR CONTEXT:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:74(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335ApplicationRef_.bootstrap @ application_ref.ts:357(anonymous function) @ application_ref.ts:105ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 DebugContext {_view: _View_AppComponent_Host0, _nodeIndex: 0, _tplRow: 0, _tplCol: 0}BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:75(anonymous function) @ application_ref.ts:345ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216NgZoneImpl.runInner @ ng_zone_impl.ts:99NgZone.run @ ng_zone.ts:210ApplicationRef_.run @ application_ref.ts:335ApplicationRef_.bootstrap @ application_ref.ts:357(anonymous function) @ application_ref.ts:105ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:88 EXCEPTION: Error in :0:0
browser_adapter.ts:78 EXCEPTION: Error in :0:0BrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 ORIGINAL EXCEPTION: No provider for Router!BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:65(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 ORIGINAL STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:69(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 Error: DI Exception
at NoProviderError.BaseException [as constructor] (exceptions.ts:14)
at NoProviderError.AbstractProviderError [as constructor] (reflective_exceptions.ts:53)
at new NoProviderError (reflective_exceptions.ts:85)
at ReflectiveInjector_._throwOrNull (reflective_injector.ts:844)
at ReflectiveInjector_._getByKeyDefault (reflective_injector.ts:873)
at ReflectiveInjector_._getByKey (reflective_injector.ts:835)
at ReflectiveInjector_.get (reflective_injector.ts:632)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:15)
at DebugAppView.AppView.create (view.ts:110)
at DebugAppView.create (view.ts:315)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:70(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 ERROR CONTEXT:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:74(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 DebugContext {_view: _View_AppComponent_Host0, _nodeIndex: 0, _tplRow: 0, _tplCol: 0}BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:75(anonymous function) @ application_ref.ts:341ZoneDelegate.invoke @ zone.js:323NgZoneImpl.inner.inner.fork.onInvoke @ ng_zone_impl.ts:67ZoneDelegate.invoke @ zone.js:322Zone.run @ zone.js:216(anonymous function) @ zone.js:571ZoneDelegate.invokeTask @ zone.js:356NgZoneImpl.inner.inner.fork.onInvokeTask @ ng_zone_impl.ts:56ZoneDelegate.invokeTask @ zone.js:355Zone.runTask @ zone.js:256drainMicroTaskQueue @ zone.js:474ZoneTask.invoke @ zone.js:426
browser_adapter.ts:88 EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: No provider for Router!
ORIGINAL STACKTRACE:
Error: DI Exception
at NoProviderError.BaseException [as constructor] (http://localhost:3000/node_modules/@angular/core/src/facade/exceptions.js:17:23)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:39:16)
at new NoProviderError (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:75:16)
at ReflectiveInjector_._throwOrNull (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:776:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:804:25)
at ReflectiveInjector_._getByKey (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:767:25)
at ReflectiveInjector_.get (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:576:21)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:15:70)
at DebugAppView.AppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:259:44)
ERROR CONTEXT:
[object Object]
browser_adapter.ts:78 EXCEPTION: Error: Uncaught (in promise): EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: No provider for Router!
ORIGINAL STACKTRACE:
Error: DI Exception
at NoProviderError.BaseException [as constructor] (http://localhost:3000/node_modules/@angular/core/src/facade/exceptions.js:17:23)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:39:16)
at new NoProviderError (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:75:16)
at ReflectiveInjector_._throwOrNull (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:776:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:804:25)
at ReflectiveInjector_._getByKey (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:767:25)
at ReflectiveInjector_.get (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:576:21)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:15:70)
at DebugAppView.AppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:259:44)
ERROR CONTEXT:
[object Object]BrowserDomAdapter.logError @ browser_adapter.ts:78BrowserDomAdapter.logGroup @ browser_adapter.ts:89ExceptionHandler.call @ exception_handler.ts:53(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.ts:138NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 STACKTRACE:BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:56(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.ts:138NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
browser_adapter.ts:78 Error: Uncaught (in promise): EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: No provider for Router!
ORIGINAL STACKTRACE:
Error: DI Exception
at NoProviderError.BaseException [as constructor] (http://localhost:3000/node_modules/@angular/core/src/facade/exceptions.js:17:23)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:39:16)
at new NoProviderError (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:75:16)
at ReflectiveInjector_._throwOrNull (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:776:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:804:25)
at ReflectiveInjector_._getByKey (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:767:25)
at ReflectiveInjector_.get (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:576:21)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:15:70)
at DebugAppView.AppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:259:44)
ERROR CONTEXT:
[object Object]
at resolvePromise (http://localhost:3000/node_modules/zone.js/dist/zone.js:538:32)
at PromiseCompleter.reject (http://localhost:3000/node_modules/zone.js/dist/zone.js:515:14)
at eval (http://localhost:3000/node_modules/@angular/core/src/application_ref.js:295:35)
at ZoneDelegate.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:323:29)
at Object.NgZoneImpl.inner.inner.fork.onInvoke (http://localhost:3000/node_modules/@angular/core/src/zone/ng_zone_impl.js:45:41)
at ZoneDelegate.invoke (http://localhost:3000/node_modules/zone.js/dist/zone.js:322:35)
at Zone.run (http://localhost:3000/node_modules/zone.js/dist/zone.js:216:44)
at http://localhost:3000/node_modules/zone.js/dist/zone.js:571:58
at ZoneDelegate.invokeTask (http://localhost:3000/node_modules/zone.js/dist/zone.js:356:38)
at Object.NgZoneImpl.inner.inner.fork.onInvokeTask (http://localhost:3000/node_modules/@angular/core/src/zone/ng_zone_impl.js:36:41)BrowserDomAdapter.logError @ browser_adapter.ts:78ExceptionHandler.call @ exception_handler.ts:57(anonymous function) @ application_ref.ts:304schedulerFn @ async.ts:131SafeSubscriber.__tryOrUnsub @ Subscriber.ts:240SafeSubscriber.next @ Subscriber.ts:192Subscriber._next @ Subscriber.ts:133Subscriber.next @ Subscriber.ts:93Subject._finalNext @ Subject.ts:154Subject._next @ Subject.ts:144Subject.next @ Subject.ts:90EventEmitter.emit @ async.ts:117NgZone._zoneImpl.ng_zone_impl_1.NgZoneImpl.onError @ ng_zone.ts:138NgZoneImpl.inner.inner.fork.onHandleError @ ng_zone_impl.ts:90ZoneDelegate.handleError @ zone.js:327Zone.runGuarded @ zone.js:233_loop_1 @ zone.js:487drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
zone.js:461 Unhandled Promise rejection: EXCEPTION: Error in :0:0
ORIGINAL EXCEPTION: No provider for Router!
ORIGINAL STACKTRACE:
Error: DI Exception
at NoProviderError.BaseException [as constructor] (http://localhost:3000/node_modules/@angular/core/src/facade/exceptions.js:17:23)
at NoProviderError.AbstractProviderError [as constructor] (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:39:16)
at new NoProviderError (http://localhost:3000/node_modules/@angular/core/src/di/reflective_exceptions.js:75:16)
at ReflectiveInjector_._throwOrNull (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:776:19)
at ReflectiveInjector_._getByKeyDefault (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:804:25)
at ReflectiveInjector_._getByKey (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:767:25)
at ReflectiveInjector_.get (http://localhost:3000/node_modules/@angular/core/src/di/reflective_injector.js:576:21)
at DebugAppView._View_AppComponent_Host0.createInternal (AppComponent_Host.template.js:15:70)
at DebugAppView.AppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:66:21)
at DebugAppView.create (http://localhost:3000/node_modules/@angular/core/src/linker/view.js:259:44)
ERROR CONTEXT:
[object Object] ; Zone: angular ; Task: Promise.then ; Value: ViewWrappedException {_wrapperMessage: "Error in :0:0", _originalException: NoProviderError, _originalStack: "Error: DI Exception↵ at NoProviderError.BaseExc…_modules/@angular/core/src/linker/view.js:259:44)", _context: DebugContext, _wrapperStack: "Error: Error in :0:0↵ at ViewWrappedException.W…st:3000/node_modules/zone.js/dist/zone.js:322:35)"}consoleError @ zone.js:461_loop_1 @ zone.js:490drainMicroTaskQueue @ zone.js:494ZoneTask.invoke @ zone.js:426
zone.js:463 Error: Uncaught (in promise): EXCEPTION: Error in :0:0(…)
我真的不知道是什么导致这个,为什么以及如何。
希望有人可以帮忙解决这个问题, 谢谢!
答案 0 :(得分:3)
更换到新的路由器系统时遇到了同样的问题。在我引导应用程序的文件中,我没有调用正确的ROUTER_PROVIDER。 它叫
import {ROUTER_PROVIDERS} from '@angular/router-deprecated';
而不是
import {ROUTER_PROVIDERS} from '@angular/router';
有太多的线要改变,难怪我跳过了一条。
答案 1 :(得分:1)
发生此问题是因为您忘记在主要组件中注册提供商。
因此,您必须导入ROUTER_PROVIDER,然后必须在组件中注册它。
import { Routes, ROUTER_DIRECTIVES, ROUTER_PROVIDERS } from '@angular/router';
... other imports
@Component({
moduleId: module.id,
selector: 'app',
templateUrl: 'app.component.html',
styleUrls: ['app.component.css'],
directives: [ROUTER_DIRECTIVES],
providers: [ROUTER_PROVIDERS]
})
来自@Component的数组提供程序非常重要。