SproutCore Todo List Error

73 Views Asked by At

Going through the SproutCore "Getting started" tutorial and have a problem.

Inside the Todos.todoListController there is a function:

Todos.todoListController = SC.ArrayController.create({

  // ...

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

For some reason, this will not show the actual number of remaining items. It displays as 'undefined':

enter image description here

I wrote the code myself on the first go around, but copied the code from the tutorial and tried it for trouble shooting - still gets the same error.

1

There are 1 best solutions below

0
On BEST ANSWER

Ok...

Just saw they host the code on GitHub and there the code works.

turns out the .get('Length') has to be a lowercase 'l'

so... .get('length') is the solution.