mardi 30 mai 2017

How to make route parameters optional in Ember.js?

In Ember.js, given these routes:

this.route('chefs', { path: ":country/chefs"});
this.route('recipies', { path: ":country/recipies"});

I am required to put the positional params in the link-to component, like:

Mexico Chefs

How can I avoid specifying some params in all my link-to components?

I'm thinking the 'chefs' route could use a default parameter coming from a service. But how? Any other ideas?

Here is a Twiddle: http://ift.tt/2rluUIG




Aucun commentaire:

Enregistrer un commentaire