Commit 37551624 authored by Ryan Eastridge's avatar Ryan Eastridge

provide itemText to stats templates

parent a0733a36
...@@ -31,9 +31,11 @@ Thorax.View.extend({ ...@@ -31,9 +31,11 @@ Thorax.View.extend({
// be called to generate the context / scope that the template // be called to generate the context / scope that the template
// will be called with. "context" defaults to "return this" // will be called with. "context" defaults to "return this"
context: function() { context: function() {
var remaining = app.Todos.remaining().length;
return { return {
itemText: remaining === 1 ? 'item' : 'items',
completed: app.Todos.completed().length, completed: app.Todos.completed().length,
remaining: app.Todos.remaining().length remaining: remaining
}; };
}, },
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment