GeezerVisonThe World Wide Web, restored to 800 pixels of glory. |
| Home|About|Gaming cabinet|Archives|How it works|Starter sites |
GeezerVison is showing github.com — watch on array does not work correctly · Issue #8 · astamuse/asta4js Open Labels DescriptionIf we watch to a existing array and then add items to the existing array, the watch function will not work correctly: Aj.init(function ($scope) { $scope.data = { list: [] }; $scope.snippet("ul").bind($scope.data, { list:{ _duplicator: "li", _item: { "nnn": { _selector: ".x-watch", _watch: { _fields: ["name"], _cal: function(v){ console.log("cal", v); return v+"-watched"; } }, _render: function(target, nv, ov, ctx){ console.log("args", arguments); console.log("idx:", ctx.getArrayAssistant().getIndex()); target.text(nv); } } } } }); $scope.data.list.push({ name: "name-" + i }); } Workaround is to reassign a new array reference to replace the existing array: $scope.data.list = Aj.util.clone($scope.data.list); $scope.data.list.push({ name: "name-" + i }); Activity
MetadataMetadataAssigneesLabelsTypeProjectsMilestoneRelationshipsDevelopmentIssue actions |
| You are visitor 01402792 — GeezerVison does not store the pages you look up. Best viewed with Netscape Navigator 4.7 or Internet Explorer 6 at 800×600. No cookies required. |