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

Update group.js #659

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open

Update group.js #659

wants to merge 1 commit into from

Conversation

comerc
Copy link

@comerc comerc commented Jun 29, 2016

Allow to use triggersEnter in Group without Array (like in FlowRouter)

It is work:

FlowRouter.route '/',
  triggersEnter: (context, redirect, stop) ->

But it has error: this._triggersEnter.concat is not a function

Routes = FlowRouter.group
  triggersEnter: (context, redirect, stop) ->

dr-dimitru added a commit to veliovgroup/flow-router that referenced this pull request Feb 23, 2017
 - Allow to use triggersEnter in Group without Array, see [PR
kadirahq#659](kadirahq#659)
dr-dimitru added a commit to veliovgroup/flow-router that referenced this pull request Feb 23, 2017
 - Allow to use triggersEnter in Group without Array, see [PR
kadirahq#659](kadirahq#659)
dr-dimitru added a commit to veliovgroup/flow-router that referenced this pull request Feb 23, 2017
 - Fix for cases when route's param isn't String
 - Fix broken redirects in triggers
 - Fix exception on `new Route()` without arguments
 - Preserve `%` and `+` symbols in URI
 - Allow to use triggersEnter in Group without Array, see [PR
kadirahq#659](kadirahq#659)
 - Fix generation of URLs with a ROOT_URL containing a path, see [PR
kadirahq#691](kadirahq#691)
 - Support RegEx ([0-9]*) in .path, see [PR
kadirahq#654](kadirahq#654)
 - Fix nested groups on server, see [PR
kadirahq#663](kadirahq#663)
 - Same behavior for Server groups, as for groups on Client
 - Add auto-tests
 - NPM Dependencies update
@brandoncanaday
Copy link

did this ever get resolved?? I'm still getting this error when attempting to add a trigger to route group and individual route in that group:

Error: "Uncaught TypeError: this._triggersEnter.concat is not a function"
Caused by: "options.triggersEnter = this._triggersEnter.concat(triggersEnter);"
Code:

const privateRoutes = FlowRouter.group({
  name: 'privateRoutesGroup',
  triggersEnter: function() {
    if(!Meteor.userId() && !Meteor.loggingIn()) redirect(FlowRouter.path('login'));
  }
})

privateRoutes.route('/home', {
  name: 'home',
  action: function() {
    BlazeLayout.render('homeLayout', {
      header: 'header',
      sidebar: 'userSidebar',
      main: 'userPool'
    });
  }
});

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