Skip to content

Allow configuration of layerIndex via router DSL #1

Open
@lukemelia

Description

@lukemelia

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);

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions