فهرست منبع

Step 4.3: Update getMeteorData to sort tasks by time.

Frederic G. MARAND 9 سال پیش
والد
کامیت
087c7dfd14
1فایلهای تغییر یافته به همراه1 افزوده شده و 1 حذف شده
  1. 1 1
      App.jsx

+ 1 - 1
App.jsx

@@ -8,7 +8,7 @@ App = React.createClass({
   // Loads items from the Tasks collection and puts them on this.data.tasks.
   getMeteorData() {
     let result = {
-      tasks: Tasks.find({}).fetch()
+      tasks: Tasks.find({}, {sort: {createdAt: -1}}).fetch()
     };
     // Meteor._debug("result", result);
     return result;