Can anyone give a good example of how to break the router up into multiple files, and is there any best practise for doing this?
Asked
Active
Viewed 353 times
1 Answers
4
Here's a really simplified version of what I'm doing. Just make sure you require the files in the right order.
//router.js
App.Router = Ember.Router.extend({
accounts: App.AccountsRoutes.extend({
route: "/account"
})
// more routes here
})
//account_routes.js
App.AccountRoutes = Ember.Route.extend({
index: Ember.Route.extend({
route: '/',
connectOutlets: function(router){
// connect here
}
})
// more routes here
})

Bradley Priest
- 7,438
- 1
- 29
- 33