0
私はAngular2アプリケーションで作業しています。子ルートが親ルートから拡張されていないことに気付きました。これは設計によるものですか?例えばAngular2ネストされたルーティングのURLが正しくありません
、私はそうのように構成されたルートを持つ親ルータがある場合:
// In top-level component
router.config([
new AsyncRoute({
path: '/designer/:id',
name: 'Designer',
loader:() =>
System.import('app/components/design.component')
.then(c => c['DesignComponent'])
}),
new AsyncRoute({
path: '/planner/:id',
name: 'Planner',
loader:() =>
System.import('app/components/plan.component')
.then(c => c['PlanComponent'])
})
]);
と子ルータなどのように、これらのコンポーネントのいずれかで定義されたルートを:
// In child component, design.component for example
router.config([
new AsyncRoute({
path: '/model',
name: 'Model',
loader:() =>
System.import('app/design/components/model.component')
.then(c => c['ModelComponent'])
})
]);
ときトップたとえば、http://localhost:5000/designer/10
のレベルのページが読み込まれますが、子ルートに移動すると、URLはhttp://localhost:5000/designer/10/model
の代わりにhttp://localhost:5000/model
になります。
http://localhost:5000/designer/10/model
実際:
http://localhost:5000/model
私はこれを試してみましたが動作していません。実際、それはまったくナビゲートしません。 '[routeLink]'を使わずに親ルータが設定されていることは重要ですか?また、RC.0では何が変更されていますか?最後に 'router.navigate'を使って'/... 'がついたルートにナビゲートするにはどうしたらいいですか? –
再生を可能にするPlunkerを作成できますか? –
Beta 17現在 –