Commit d3e57434 authored by Addy Osmani's avatar Addy Osmani

Polymer: fixes localstorage, filtering.

parent f2ffd976
......@@ -9,15 +9,16 @@
allCompleted: false,
ready: function() {
this.asyncMethod(function() {
this.items = this.items || [];
this.items = this.storage.value || [];
});
},
filterChanged: function() {
this.filterItems();
this.asyncMethod(function() {
this.filterItems();
});
},
itemsChanged: function() {
this.completedCount =
this.items.filter(this.filters.completed).length;
this.completedCount = this.items.filter(this.filters.completed).length;
this.activeCount = this.items.length - this.completedCount;
this.allCompleted = this.completedCount && !this.activeCount;
this.filterItems();
......
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