Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Allow configuration of layerIndex via router DSL #1

Open
lukemelia opened this issue Jan 5, 2018 · 0 comments
Open

Allow configuration of layerIndex via router DSL #1

lukemelia opened this issue Jan 5, 2018 · 0 comments

Comments

@lukemelia
Copy link
Contributor

Also allow specifying a base class for the route instance.

It would be nice to have this flexibility via Ember's router DSL, but I don't think that is possible today. Instead, we could have our own code that consumes the same function passed to Router.map. It might look like this:

let dsl = function() {
  this.route('yapp', { path: '/yapp/', resetNamespace: true }, function() {
    this.route('page', { path: '/pages/:page_id', resetNamespace: true }, function() {
      this.route('schedule-item', { path: '/schedule-items/:schedule_item_id', resetNamespace: true }, function() {
        this.route('person', { openInNewLayer: true });
      });
      this.route('track', { path: '/tracks/:track_id', resetNamespace: true }, function() {
        this.route('schedule-item', { path: '/schedule-items/:schedule_item_id' }, function() {
          this.route('person', { openInNewLayer: true, routeClass: 'schedule-item.person' });
        });
      });
    });
  });
};

Router.map(dsl);
NavStack.process(dsl);
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant