みんな。 私は@ angular/routerを持っています。 私のアプリケーションのルート設定があります。子供用ナビゲーションAngular2
Router [] = [
{
path: 'main',
component: MainComponent,
children: [
{
path: 'info',
component: InfoComponent
}
]
}
と私は、次のフローがあります。私のエントリーページをし、それだけでDBからオブジェクトを得ること、MainComponentに移動します。 MainComponentの内部ではthis.router.navigate(['info'], {relativeTo: this.route})
を使用します。 がMainComponent
export class InfoComponent extends OnInit {
constructor (@Host() private parent: MainComponent) {}
...
ngOnInit() { `componentResolver is done` }
}
から親に依存して私はcomponentResolverを持ってInfoComponentでは、問題は、私はクロームナビゲーションバーの[戻る]ボタンで戻って移動するときに、ある、またはAltキー+ <をクリックすると、それだけで空のビューを私に示しています(MainComponent)。 私の問題はどこにありますか?これはどうして起こったのですか?
これは私がの一つにこの設定を持っている 'Router.navigate' – Dummy
の呼び出しとまったく同じです私のアプリケーションと私は戻ってナビゲートするときにOPが述べた問題はありません。 –