How to create nested routes

I'm not very clear on how to make a route with this structure: http: // localhost: 9000 / # / vendors / 557794d4dda4a5b6162aab53 / services / 413jdjo53j2ojo532

In the last blog I see links to child / parent routes and looking for parent parameters from the child, but in the docs I only see links to child routers and having a brand new router seems a bit like an overkill for this.

What is the best way to create such a route and be able to find data from the parent route? How to achieve route hierarchy (like in Ember)?

+3


source to share


1 answer


I found that the easiest way to share data between child and parent route is using shared state, just create a class

export class State {
    status = null
}

      



And then inject

it is in both parent and child viewmodels, by default it will be single so you can use it to pass data.

0


source







All Articles