瀏覽代碼

Commit 8.4: Add incompleteCount helper to body.

Frederic G. MARAND 8 年之前
父節點
當前提交
7b0bfc8e7c
共有 1 個文件被更改,包括 5 次插入0 次删除
  1. 5 0
      simple-todos.js

+ 5 - 0
simple-todos.js

@@ -14,6 +14,11 @@ if (Meteor.isClient) {
     hideCompleted: function () {
       var ret = Session.get("hideCompleted");
       return ret;
+    },
+
+    incompleteCount: function () {
+      var ret = Tasks.find({ checked: { $ne: true }}).count();
+      return ret;
     }
   });