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

Persist options object on route groups #378

Merged
merged 1 commit into from
Nov 2, 2015

Conversation

johanbrook
Copy link
Contributor

Addressing #375.

This patch saves the options object on a group, so it can be retrieved from a route later.

const group = FlowRouter.group({
  name: 'admin',
  prefix: '/admin',
  layout: 'AdminLayout'
});

group.route('/path', {
  action() {
    // this.group.options will here be:
    // { name: 'admin', prefix: '/admin', layout: 'AdminLayout' }
    BlazeLayout.render(this.group.options.layout, 'template');
  }
});

My first idea was to omit the name and prefix properties when attaching on the group, but that would be inconsistent with how it's done for a Route.

@arunoda
Copy link
Contributor

arunoda commented Nov 2, 2015

Sounds good to me.

arunoda added a commit that referenced this pull request Nov 2, 2015
@arunoda arunoda merged commit b9e59f4 into kadirahq:master Nov 2, 2015
@arunoda
Copy link
Contributor

arunoda commented Nov 2, 2015

Published as: v2.8.0

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

Successfully merging this pull request may close these issues.

2 participants