I am trying to build an application with Ember.js, with routing, roles, login, logout, and all. My problem right now is that I cannot figure out how to deal with dynamic routing.
What I need, is to be able to use one route for sidebar navigation.
When the user logs in, he/she will get to the dashboard view. Say they click Post menu on the left, then they will see a posts view. I want to deal with these in the same route, something like /:module/.
module: Ember.Route.extend({
route: '/admin/:module/',
doLogout: Ember.Route.transitionTo('login'),
connectOutlets: function (router) {
"use strict";
router.get('applicationController').connectOutlet('sidebar', 'sidebar');
router.get('applicationController').connectOutlet('toolbar', 'toolbar');
}
})
This is where I need a bit of help. How does the dynamic routing work exactly? Probably the only thing I found so far is @wycats' gist on ROuting here, but I could not figure it out from there: https://gist.github.com/2728699