vendredi 24 février 2017

How to set nested route path same level as the parent route?

  this.route('browse', { path: '/points' }, function() {
    this.route('quiz', { path: '/quiz' });
    this.route('learn', { path: '/learn' });
  });
  this.route('post', { path: '/post' }, function() {
    this.route('star', { path: '/star' });
    this.route('marked', { path: '/marked' });
  });

The reason I want to do this is that I would like to share same base template between nested routes and I do not put all these into application template (otherwise I need to place so many condition block in it).

What I want to achive is

browse       -> /points
browse.quiz  -> /quiz
browse.learn -> /learn

post         -> /posts
post.star    -> /star
post.marked  -> /marked




Aucun commentaire:

Enregistrer un commentaire