I’m writing a simple software as a service like app where each customer defines a set of configuration for a specific component. Then at runtime I need to construct a range of models based on this configuration.
My question is when should I lookup the configuration and build the array of dynamic ember objects to represent these models?
Currently I’m playing around with this inside the setupControllers function of the ApplicationRoute itself (as it’s only loaded 1x when the app is loaded and then I’ll have the array of models at any moment instead of waiting for them just in time later on.)
This set of configuration is minimal and the performance gains from this approach are worth it for this example. But is this the right component to load these up / create dynamic models?
It depends of course 😉
loadingstate while the lookup happens, thensetupControllersis too late. In that case consider using themodelhook instead.setupControllerscallback on a subroute.Yes – in this case I’d say
setupControllerson application route is a good choice.