Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ThingsListController = RouteController.extend({
- template: 'thingsList',
- findOptions: function() {
- return {sort: this.sort};
- },
- onBeforeAction: function() {
- this.thingsSub = Meteor.subscribe('things', this.findOptions());
- },
- things: function(){
- return things.find({}, this.findOptions());
- },
- data: function() {
- return {
- posts: this.posts(),
- ready: this.postsSub.ready
- };
- }
- });
- PriceThingsListController = ThingsListController.extend({
- sort: {price: -1}
- });
- Router.map(function() {
- this.route('thingsByPrice', {
- path: '/price',
- controller: PriceThingsListController
- });
- });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement