Redirect first-time visitors to info page
Updated routing to use MainPage as the default route and added logic in App component to redirect users to the /info page on their first visit using sessionStorage.
This commit is contained in:
@@ -2,9 +2,11 @@ import { NgModule } from '@angular/core';
|
||||
import { RouterModule, Routes } from '@angular/router';
|
||||
import { PocModelComponent } from './poc-model-component/poc-model-component';
|
||||
import { HomeComponent } from './home-component/home-component';
|
||||
import { MainPage } from './main-page/main-page';
|
||||
|
||||
const routes: Routes = [
|
||||
{ path: '', component: HomeComponent, pathMatch: 'full' },
|
||||
{ path: '', component: MainPage, pathMatch: 'full' },
|
||||
{ path: 'info', component: HomeComponent },
|
||||
{ path: 'poc-model', component: PocModelComponent },
|
||||
{ path: '**', component: HomeComponent },
|
||||
];
|
||||
|
||||
Reference in New Issue
Block a user