Here is my app.routes
:
const routes: Routes = [
{
path: "login",
component: LoginComponent
},
{
path: "users",
component: UsersComponent
},
{
path: "error",
component: ErreurComponent
},
{
path: "more/complex/path",
component: FooComponent
},
{
path: "",
component: HomepageComponent,
}
]
export const APP_ROUTER_MODULE = RouterModule.forRoot(routes)
Why can't I specify a state or a name for my routes ? If I want to know if wether or not I am on the error page, I then have to check the current route and look for what I have specified in "path" (see also my FooComponent
above). I found this a bit silly. Is there anyway to work around this ?