1
페이지 새로 고침시 '/ splash'경로로 탐색을 강제로 할 수 있습니까?페이지 새로 고침시 라우터를 재설정하는 방법은 무엇입니까?
'/ discover'에서 자신을 발견하고 페이지를 새로 고치면 응용 프로그램이 처음부터 다시 시작하는 것을 선호합니다 (/ splash).
const appRoutes: Routes = [
{ path: '', redirectTo: '/splash', pathMatch: 'full' },
{ path: 'splash' , component: SplashComponent },
{ path: 'discover' , component: DiscoverComponent },
{ path: 'broadcast' , component: BroadcastComponent },
{ path: 'notifications' , component: NotificationsComponent },
{ path: 'notifications/:key' , component: NotificationComponent }
];
export const routing: ModuleWithProviders = RouterModule.forRoot(appRoutes);
내 부모 AppComponent의 OnInit
& OnDestroy
방법 내에서 router.navigate
통화를 시도했습니다
ngOnInit() : void {
this.router.navigate(['splash']);
}
는 또한 라우터 자체의
OnDestroy
방법 내에서 탐색 통화를 시도했습니다.
당신은 웹 서버의 어떤 종류를 사용합니까? 아파치? – BeetleJuice