子节点之间的路由没有重新加载父Angular +2

时间:2018-02-05 12:25:57

标签: angular routing

我有这条路线配置

{
                path: 'Settings',
                component: SettingsComponent,
                canActivate: [SiteRouteGuard],
                children: [
                    {
                        path: '',
                        redirectTo: 'General', pathMatch: 'full'

                    },
                    {
                        path: 'ChangePassword',
                        component: ChangePasswordComponent,
                        canActivate: [SiteRouteGuard]

                    },
                    {
                        path: 'Privacy',
                        component: PrivacySettingsComponent,
                        canActivate: [SiteRouteGuard]

                    },
                    {
                        path: 'Links',
                        component: LinksComponent,
                        canActivate: [SiteRouteGuard]

                    },
                    {
                        path: 'Profile',
                        component: ProfileInfoComponent,
                        canActivate: [SiteRouteGuard]

                    },
                    {
                        path: 'General',
                        component: GeneralSettingsComponent,
                        canActivate: [SiteRouteGuard]

                    },

                ],
            },

如果我将SettingsComponent中的函数放在ngOnInit()内,例如load()。如果我在每次调用函数ChangePassword时在Privacy组件和load()组件之间进行路由。如何停止重新加载父项并在其子项之间路由?

0 个答案:

没有答案