Created
November 28, 2014 13:57
-
-
Save tanis2000/aefd0c3abdb381ee4d87 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Router.configure({ | |
layoutTemplate: 'layout', | |
notFoundTemplate: 'not_found', | |
waitOn: function () { | |
return [ Meteor.subscribe('currentUser')]; | |
}, | |
load: function() { | |
} | |
}); | |
Router.route('/', function() { | |
this.render('home'); | |
}); | |
Router.route('/admin/surveys', { | |
waitOn: function() { | |
return Meteor.subscribe('surveys'); | |
}, | |
data: function() { | |
return { items: App.Model.Surveys.find({}), name: 'Survey', fields:['title'], collection: App.Model.Surveys}; | |
}, | |
action: function() { | |
this.render('admin_list'); | |
} | |
}); | |
Router.route('/admin/users', { | |
waitOn: function() { | |
return Meteor.subscribe('users'); | |
}, | |
data: function() { | |
return { items: Meteor.users.find({}), name: 'User', fields:['username'], collection: Meteor.users}; | |
}, | |
action: function() { | |
this.render('admin_list'); | |
} | |
}); | |
Router.route('/test', function() { | |
this.response.end("test\n"); | |
}, {where: 'server'}); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment