Here is a simplified version of my routes:
/
/sites
/:site_id
/settings
/user-defined-params
/:param_id
I need to display a table-list of parameters assigned to a specific site in the /user-defined-params
route. However, the models for sites and params are not related, so I can't fetch them via a simple relation.
Should the model()
hook for my router return a list of these params? By default, the model seems to be the site loaded from the parent route (:site_id
). What if loading the data takes time and I want to display the table first with a loading indicator until the data fills in?
When I try to load the data in the model()
hook, the transition blocks. If I try in the afterModel()
hook, I struggle to make it available for the template without manually assigning the params
property to the site
model, which doesn't feel right.
I have searched online for examples but haven't found one that addresses this scenario. Any tips on how to load the data without blocking the transition would be greatly appreciated.