Something that I recently noticed with the Ember Router is only to allow navigation on leaf routes - routes without children's routes.
Now, if I do it wrong, this seems like a design error / error.
Take for example something like this:
I have a set of projects, each project has many collaborators, with this I want to create a user interface with a three-column layout (something like your standard email client), where on the left I have a list of projects, when I click on the project, the middle column displays a list of collaborators, and clicking on a collaborator loads its data into the right column.
Now, with the help of routing, I want to go to /projects/1
when I click on a project and to /projects/1/collaborators/23
when I click on a co-author.
Here is a router illustrating the first part of a nested route:
App.reopen( Router: Ember.Router.extend( enableLogging: true location: 'hash' root: Ember.Route.extend( index: Ember.Route.extend( route: '/' redirectsTo: 'projects' ) projects: Ember.Route.extend(
As you will see, Ember does not call updateRoute (set the URL) before going to root.projects.show
because of this line https://github.com/emberjs/ember.js/blob/master/packages/ember-routing/lib /routable.js#L81
Has anyone else done something like this? Is there a better way to develop this?
source share