2016-06-18 6 views
0

私はとMeteorを学ぶために社会的なアプリのチュートリアルを使用しています。私は、私が根本的な原因を見つけることができないという問題に遭遇しました。routeconfigを使用しているときに、 'annotations'のプロパティが未定義です。

私が追加することを述べてtutorialを以下のよ:

RouteConfig注釈:app.htmlで

@RouteConfig([ 
    { 
    path: '/', 
    as: 'PartiesList', 
    component: PartiesList 
    }, { 
    path: '/party/:partyId', 
    as: 'PartyDetails', 
    component: PartyDetails 
    } 
]); 

router-outlet

<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を削除した場合、例外は発生しませんが、コンテンツが表示されないため、何も表示されません。これを引き起こす原因は何ですか?

答えて

0

あるRouting & Navigation

でドキュメント上で読むには、執筆時点で箱から出して動作し、新しいバージョンを思い付いています。私はまた、事故によって、パッケージをインストールする方法を考え出しました。私は必要な新しいパッケージを取得するには、どのコマンドを使用

0

@RouterConfigは、以前のバージョンのルータでは廃止され、rc1でのみ使用できます。 新しいリリースでは3.0.0.apha.7もなくなりました。角度と流星時間使用例は、現在いくつかの時間後に

export const DashboarRoutes = [ 
    { 
    path: 'dashboard', 
    component: DashboardComponent 
    }, 
    ... 
    e.t.c  
] 
export const routes: RouterConfig = [ 
...DashboardRoutes, 
...UIRoutes 
]; 

export const APP_ROUTER_PROVIDERS = [ 
    provideRouter(routes) 
]; 


APP_ROUTER_PROVIDERS is then passed when bootstrapping main application 
+0

角度コアパッケージをインストールするには、例えば

meteor npm install @angular/core 

:あなたは次の形式を使用できますか?あなたの提案を試みましたが、コンポーネントは解決されていません – mmelsen

+0

新しいルータ3.0.0.a7.7を使用すると、上記で説明した設定でコンポーネントが未定義に戻っているようです。何か案は? – Colum

+0

うん、戻り値は未定義です。 – twilliams

関連する問題