Commit ce54b52b authored by Pascal Hartig's avatar Pascal Hartig

canjs_require: Fixed remaining item count

parent a7fa2f2b
......@@ -16,8 +16,8 @@ require(['can/util/library', 'can/route', 'app/todos', 'app/models/todo', 'can/v
route.ready(false);
// View helper for pluralizing strings
can.Mustache.registerHelper('plural', function (str, count) {
return str + (count !== 1 ? 's' : '');
can.Mustache.registerHelper('todoPlural', function (str, attr) {
return str + (attr.call(this.todos) !== 1 ? 's' : '');
});
// Find all Todos
......
......@@ -22,7 +22,7 @@
<footer id="footer" class="{{^todos}}hidden{{/todos}}">
<span id="todo-count">
<strong>{{todos.remaining}}</strong> {{plural "item" todos.remaining}} left
<strong>{{todos.remaining}}</strong> {{todoPlural "item" todos.remaining}} left
</span>
<ul id="filters">
<li><a class="selected" href="#!">All</a></li>
......
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