I currently have a master-detail style setup using named outlets which seems to work fine. With the emphasis of components being the future I am wondering how I can use components for this instead of named outlets.
The problem I am having is that I cannot pass the model for the detail view to the component because the component lives in a route higher up. Let me explain.
The ‘/users’ route renders the ‘users.hbs’ template and in that template I call a ‘user-detail’ component. What I would like is for that user-detail component to be supplied with a user model when the /users/:user_id route is visited. As the component doesn’t live on the ‘/users/:user_id’ level I have no way to pass it the model.
I could just call the component in ‘users/detail.hbs’ instead, but then all my future detail views would be limited to existing within this components template, ideally I would like to render these in ‘users.hbs’ so that I have more flexibility on placement.
Is there a correct way to do this or are components just a bad fit for this design?
Please let me know if I have not explained this very well, it hurt my head just writing it!