Saturday, 17 August 2013

How does EmberJS select template for a Route?

How does EmberJS select template for a Route?

I have these routes defined:
this.resource('projects', function() {
this.resource('project', { path: ':project_id'}, function() {
this.route('details');
this.route('members');
});
});
What I thought was that by convention project.details route would look for
"project/details" template. It does but strangely it does not get the
correct model. See http://jsbin.com/ELaxigE/19/edit
Now instead of providing "project/details" template if I create "project"
template then it works. See http://jsbin.com/ELaxigE/21/edit
I am confused what is happening. Can someone explain?

No comments:

Post a Comment