We are working on an Angular app which includes a lot of nested views.
I will give a brief example here,
- We have a Cities,
- A city can have multiple regions
- A region has list of schools
- School has classes
- A class has students and student can have his details.
This is just a part of the app, we have many such other nested routes.
Now, the way I have configured the route is -
.state('city', {
url: '/city'
// Other stuff removed for sanity
})
.state('city.details', {
url: '/:cityId/details'
// Other stuff removed for sanity
})
.state('city.schools', {
url: ':cityId/schools'
// Other stuff removed for sanity
})
.state('city.schools.details', {
url: '/:schoolId/details'
// Other stuff removed for sanity
})
.state('city.schools.students', {
url: '/:schoolId/students'
// Other stuff removed for sanity
})
.state('city.schools.students.details', {
url: '/:studentId/details'
// Other stuff removed for sanity
})
.state('city.schools.students.timeline', {
url: '/:studentId/timeline'
// Other stuff removed for sanity
})
.state('city.schools.students.timeline.details', {
url: '/:timelineId/details'
// Other stuff removed for sanity
})
The routing is something similar to this. Everything works just perfectly fine, However when I am at the deepest route especially with Guids as unique identifier i.e.
https://www.contoso.com/#/city/949C3148-5E74-41E2-BF2A-17C49FBCC15F/schools/4DE61D87-0DFB-445E-B4B0-3E1A3BB1DB30/students/EF56D682-BCFB-4431-A5EF-7F1F8CF4915D/timeline/14442B0A-0856-4269-A771-3B1BA8B283D1/details
This is way too long URL and is not user friendly if I am not wrong.
Is there any room for optimizing this sort of route? Any expert advice would be helpful.
Rahul.