我有这条路线配置
{
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()
组件之间进行路由。如何停止重新加载父项并在其子项之间路由?