Skip to content

Instantly share code, notes, and snippets.

@aaronthorp
Created July 25, 2014 09:46
Show Gist options
  • Save aaronthorp/0d673980eb6fd7e3a41d to your computer and use it in GitHub Desktop.
Save aaronthorp/0d673980eb6fd7e3a41d to your computer and use it in GitHub Desktop.
Router.onBeforeAction('loading');
Router.map(function() {
this.route('project', {
path: '/:_domain/projects/:_project',
data: function() {
return {'name': this.params._domain};
},
waitOn: function(){
return [subs.subscribe('userDomains', this.params._domain)];
},
onAfterAction: function() {
document.title = "Project";
if(Domains.find().count() === 0) {
Router.go('register');
}
}
});
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment