Evan You 12 lat temu
rodzic
commit
c1c0b3a036
3 zmienionych plików z 7 dodań i 4 usunięć
  1. 4 1
      TODO.md
  2. 1 1
      examples/todos/app.js
  3. 2 2
      src/seed.js

+ 4 - 1
TODO.md

@@ -1,5 +1,8 @@
+- getter setter should emit events
+- auto dependency extraction for computed properties (evaluate, record triggered getters)
+- use descriptor for computed properties
+
 - parse textNodes?
-- method invoke with arguments
 - limited set of expressions (e.g. ternary operator)
 - more directives / filters
     - sd-if

+ 1 - 1
examples/todos/app.js

@@ -11,7 +11,7 @@ Seed.controller('Todos', function (scope) {
 
     // regular properties -----------------------------------------------------
     scope.todos = todos
-    scope.filter = 'all'
+    scope.filter = window.location.hash.slice(2)
     scope.allDone = false
     scope.remaining = todos.reduce(function (count, todo) {
         return count + (todo.done ? 0 : 1)

+ 2 - 2
src/seed.js

@@ -65,7 +65,7 @@ Seed.prototype._compileNode = function (node, root) {
 
         self._compileTextNode(node)
 
-    } else if (node.nodeType !== 8) { // exclude comment nodes
+    } else if (node.nodeType === 1) {
 
         var eachExp = node.getAttribute(eachAttr),
             ctrlExp = node.getAttribute(ctrlAttr)
@@ -192,7 +192,7 @@ Seed.prototype._createBinding = function (key) {
             return binding.value
         },
         set: function (value) {
-            if (value === binding) return
+            if (value === binding.value) return
             binding.changed = true
             binding.value = value
             binding.instances.forEach(function (instance) {