我正在使用社交应用教程来学习Angular2和Meteor。我遇到了一个我找不到根本原因的问题。
我正在关注一个说明要添加的教程:
RouteConfig
注解:
@RouteConfig([
{
path: '/',
as: 'PartiesList',
component: PartiesList
}, {
path: '/party/:partyId',
as: 'PartyDetails',
component: PartyDetails
}
]);
router-outlet
在 app.html 中:
<router-outlet></router-outlet>
在 Chrome 中加载应用程序时出现此异常:
EXCEPTION: Error in /client/app.html:0:0BrowserDomAdapter.logError @
modules.js?hash=12bd683…:59337BrowserDomAdapter.logGroup @ modules.js?
hash=12bd683…:59347ExceptionHandler.call @ modules.js?
hash=12bd683…:48750(anonymous function) @ modules.js?
hash=12bd683…:54194ZoneDelegate.invoke @ modules.js?
hash=12bd683…:107413onInvoke @ modules.js?
hash=12bd683…:54615ZoneDelegate.invoke @ modules.js?
hash=12bd683…:107412Zone.run @ modules.js?
hash=12bd683…:107306NgZoneImpl.runInner @ modules.js?
hash=12bd683…:54646NgZone.run @ modules.js?
hash=12bd683…:54538ApplicationRef_.run @ modules.js?
hash=12bd683…:54183ApplicationRef_.bootstrap @ modules.js?
hash=12bd683…:54205(anonymous function) @ modules.js?
hash=12bd683…:53993(anonymous function) @ meteor.js?
hash=ae8b8af…:1105ZoneDelegate.invoke @ modules.js?
hash=12bd683…:107413onInvoke @ modules.js?
hash=12bd683…:54615ZoneDelegate.invoke @ modules.js?
hash=12bd683…:107412Zone.run
...
modules.js?hash=12bd683…:59337 TypeError: Cannot read property 'annotations'
of undefined
at RouteRegistry.configFromComponent (modules.js?hash=12bd683…:87825)
at new RootRouter (modules.js?hash=12bd683…:87151)
at routerFactory (modules.js?hash=12bd683…:89570)
at ReflectiveInjector_._instantiate (modules.js?hash=12bd683…:50544)
at ReflectiveInjector_._instantiateProvider (modules.js?hash=12bd683…:50473)
at ReflectiveInjector_._new (modules.js?hash=12bd683…:50462)
at ReflectiveInjectorDynamicStrategy.getObjByKeyId (modules.js?hash=12bd683…:50117)
at ReflectiveInjector_._getByKeyDefault (modules.js?hash=12bd683…:50642)
at ReflectiveInjector_._getByKey (modules.js?hash=12bd683…:50614)
at ReflectiveInjector_.get (modules.js?hash=12bd683…:50423)
如果我删除,@RouteConfig
则不会发生异常,但没有任何内容明显显示,因为没有内容要呈现。知道是什么原因造成的吗?