angular - Create a detail view under a parent route -


you surely know heroes sample angular 2 tutorial:

https://angular.io/resources/live-examples/toh-5/ts/plnkr.html 

when click 1 of 4 top heroes /dashboard url detail/id url.

that whole dashboard component switched detail component fine!

what have changed url changes /dashboard /dashboard/detail/id

so in route config change

path: '/detail/:id', 

to

  path: '/dashboard/detail/:id', 

that works when dashboard url changed /dashboard/detail/:id url makes no sense anymore.

i configure detail route depending 'parent' route.

how can this?

i've changed routing show how can done, see plunkr.

in general done using non-terminal routes , child routers.

{   path: '/dashboard/...',   name: 'dashboard',   component: dashboardcomponent,   useasdefault: true } 

Comments

Popular posts from this blog

java - nested exception is org.hibernate.exception.SQLGrammarException: could not extract ResultSet Hibernate+SpringMVC -

sql - Postgresql tables exists, but getting "relation does not exist" when querying -

asp.net mvc - breakpoint on javascript in CSHTML? -