Advertisement
Guest User

Untitled

a guest
Sep 30th, 2014
170
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  1. ThingsListController = RouteController.extend({
  2.   template: 'thingsList',
  3.   findOptions: function() {
  4.     return {sort: this.sort};
  5.   },
  6.   onBeforeAction: function() {
  7.     this.thingsSub = Meteor.subscribe('things', this.findOptions());
  8.   },
  9.   things: function(){
  10.     return things.find({}, this.findOptions());
  11.   },
  12.   data: function() {
  13.     return {
  14.       posts: this.posts(),
  15.       ready: this.postsSub.ready
  16.     };
  17.   }
  18. });
  19.  
  20. PriceThingsListController = ThingsListController.extend({
  21.   sort: {price: -1}
  22. });
  23.  
  24. Router.map(function() {
  25.   this.route('thingsByPrice', {
  26.     path: '/price',
  27.     controller: PriceThingsListController
  28.   });
  29. });
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement