In our app we have a primary singleton resource that uses resources from several global lists.
At first we added initializers to the app to load the various global lists, but then we realized another way to do it is to just add nested pathless routes. Then we can lazily load the global resources in SomeResourceRoute->model.
So it looks like this:
@resource 'fonts', path '', -> @resource 'arts', path: '', -> @resource 'widget' -> @resource 'art, @resource 'texts', -> @route 'new', @resource 'text, path: ":text_id" App.FontsRoute = Ember.Route.extend model: -> if !App.get('fonts') App.set('fonts', @session.query('font')) return App.get('fonts')
etc. It makes it easy to setup the lists of resource and their templates.
Are there any downsides to this? In this case the nesting is somewhat arbitrary, and not accessible in the actual url.