I think it depends on the data model. It seems like in both cases you’re editing the same model (product:1). If that’s the case the model should be easily available on the edit
route as well as the channels
and colors
routes. You can use this.modelFor('product.edit')
to look up the current model for a route.
Alternatively, if this is state not available on the model you could use a service to house this data (e.g. services/edit-product
). We do this in our application sometimes for more complex situations that involve multiple screens / routes consuming the same piece of data. The common route ancestor, in this case product.edit
, can initialize the service on it’s setupController
hook. Similarly, that route can have a saveProduct
action. Any component or controller that needs to access this data can use Ember.inject.service
.
That later solution should probably be used a little more sparingly because it does create multiple dependencies and entanglement. But sometimes that’s what’s necessary.