2012-01-31 87 views
0

继续阅读SproutCore "Getting started"教程并遇到问题。SproutCore待办事项列表错误

的Todos.todoListController里面有一个功能:

Todos.todoListController = SC.ArrayController.create({ 

    // ... 

    remaining: function() { 
    return this.filterProperty('isDone', false).get('Length'); 
    }.property('@each.isDone') 
}); 

出于某种原因,这将不显示其余项目的实际数量。它显示为“未定义”:

enter image description here

我写的代码自己的第一个绕过去,但是从本教程复制的代码,并尝试了故障 - 仍然得到同样的错误。

回答

0

好的...

刚才看到他们在GitHub上托管代码,代码有效。

原来,.get('Length')必须是一个小写的 'L'

所以... .get('length')是解决方案。