Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

Pretty stupid bug

  • Loading branch information...
commit e5bb2f4d5b3bada0a2b88142adfeedcde8e2fdaa 1 parent f662569
@MathieuLorber authored
Showing with 2 additions and 5 deletions.
  1. +2 −5 labs/architecture-examples/dart/todomvc/todomvc.dart
View
7 labs/architecture-examples/dart/todomvc/todomvc.dart
@@ -80,11 +80,8 @@ void updateCounts() {
});
checkAllCheckboxElement.checked = (complete == todoElements.length);
window.console.log('left : {$complete}');
- if(complete == 1) {
- countElement.innerHTML = '1 item left';
- } else {
- countElement.innerHTML = '${todoElements.length - complete} items left';
- }
+ int left = todoElements.length - complete;
+ countElement.innerHTML = '${left} item${left != 1 ? 's' : ''} left';
if(complete == 0) {
clearCompletedElement.style.display = 'none';
} else {
Please sign in to comment.
Something went wrong with that request. Please try again.