Notes
What Does it Do?
import { createNote, Note } from 'routeshub';
import { ViewComponent } from '../view.component';
import { SuperPlaceComponent } from '../super-place.component';
import { CityComponent } from '../city.component';
export const routes: Routes = [
{
path: '',
pathMatch: 'full',
component: ViewComponent,
children: [
{
path: '',
redirectTo: 'about',
},
{
path: 'about',
loadChildren: () => import('app/views/about/about.module').then(m => m.AboutModule)
}
]
},
{
path: 'super-place',
pathMatch: 'full',
component: SuperPlaceComponent
},
{
path: 'super_place/:city',
pathMatch: 'full',
component: CityComponent
}
{
path: '**',
redirectTo: ''
}
];
// note of those routes generates under the hood of createRoot/createFeature functions
export const appUnit = createRoot(routes);
// now, appUnit is equal to
{
root: { path: '', name: 'root', children: [
{
root: { path: '', name: 'root' },
about: { path: 'about', name: 'about' }
}
]},
superPlace: { path: 'super-place', name: 'superPlace' },
city: { path: 'super_place/:city', name: 'city' },
notFound:{ path: '**', name: 'notFound' }
}Last updated
Was this helpful?