Skip to content

Commit

Permalink
provide itemText to stats templates
Browse files Browse the repository at this point in the history
  • Loading branch information
Ryan Eastridge committed Sep 20, 2012
1 parent a0733a3 commit 3755162
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion labs/architecture-examples/thorax/js/views/stats.js
Original file line number Diff line number Diff line change
Expand Up @@ -31,9 +31,11 @@ Thorax.View.extend({
// be called to generate the context / scope that the template
// will be called with. "context" defaults to "return this"
context: function() {
var remaining = app.Todos.remaining().length;
return {
itemText: remaining === 1 ? 'item' : 'items',
completed: app.Todos.completed().length,
remaining: app.Todos.remaining().length
remaining: remaining
};
},

Expand Down

0 comments on commit 3755162

Please sign in to comment.