{
path: '',
component: componentA,
children: [
{
path: '',
component: componentB,
pathMatch: 'full'
},
{
path: 'upload',
component: UploadComponent,
children: [
{
path: 'step_1',
component: StepOneComponent,
pathMatch: 'full'
},
{
path: 'step_2',
component: StepTwoComponent,
pathMatch: 'full'
},
...
Текущее поведение:
В ngOnInit()
из UploadComponent
Я делаю это:
ngOnInit() {
this.router.navigateTo(['step_1']);
}
Если вы находитесь на StepTwoComponent
и обновите страницу sh, которую вы перенаправляете на StepOneComponent
.
Я предполагаю, что это происходит потому, что сначала загружается UploadComponent
, который перенаправляет на StepOneComponent
вместо текущего.
UploadComponent.html
состоит из:
<div>
<!-- some content -->
</div>
<div>
<!-- some content -->
<router-outlet></router-outlet>
<!-- some content -->
</div>
Вопрос:
Как сделать ссылку sh, чтобы не перенаправлять на StepOneComponent
, а на текущий