Skip to content

Commit

Permalink
Replace deprecated router function
Browse files Browse the repository at this point in the history
  • Loading branch information
Selwyn authored and glasser committed Apr 14, 2015
1 parent 867209d commit f429c6a
Showing 1 changed file with 26 additions and 28 deletions.
54 changes: 26 additions & 28 deletions examples/todos/lib/router.js
Original file line number Diff line number Diff line change
Expand Up @@ -30,34 +30,32 @@ if (Meteor.isClient) {
Router.onBeforeAction('dataNotFound', {except: ['join', 'signin']});
}

Router.map(function() {
this.route('join');
this.route('signin');

this.route('listsShow', {
path: '/lists/:_id',
// subscribe to todos before the page is rendered but don't wait on the
// subscription, we'll just render the items as they arrive
onBeforeAction: function () {
this.todosHandle = Meteor.subscribe('todos', this.params._id);

if (this.ready()) {
// Handle for launch screen defined in app-body.js
dataReadyHold.release();
}
},
data: function () {
return Lists.findOne(this.params._id);
},
action: function () {
this.render();
Router.route('join');
Router.route('signin');

Router.route('listsShow', {
path: '/lists/:_id',
// subscribe to todos before the page is rendered but don't wait on the
// subscription, we'll just render the items as they arrive
onBeforeAction: function () {
this.todosHandle = Meteor.subscribe('todos', this.params._id);

if (this.ready()) {
// Handle for launch screen defined in app-body.js
dataReadyHold.release();
}
});
},
data: function () {
return Lists.findOne(this.params._id);
},
action: function () {
this.render();
}
});

this.route('home', {
path: '/',
action: function() {
Router.go('listsShow', Lists.findOne());
}
});
Router.route('home', {
path: '/',
action: function() {
Router.go('listsShow', Lists.findOne());
}
});

0 comments on commit f429c6a

Please sign in to comment.