YoniGeek
YoniGeek

Reputation: 4093

problems with this event in AngularJS

I playing with AngularJS, now when I want to follow this example:

Everthings works untill when I want to fire up the last event: clearCompleted(); My browser complains right away saying:

$scope.clearCompleted = function(){

        $scope.todos = _.filter($scope.todos, function(todo){
                    return !todo.done;
                });

    };

ReferenceError: _ is not defined at Object.TodoCtrl.$scope.clearCompleted

and I knwo that it just this event...wondering why? I also dont understand this syntax: _.filter (what is this _.?) I have feeling that is this: ** _.filter(....**

any idea?

Thanks very much for yr time! Y/

Upvotes: 0

Views: 83

Answers (1)

Anders Ekdahl
Anders Ekdahl

Reputation: 22943

It seems as if your trying to use Underscore.js without including it in a script tag.

Upvotes: 1

Related Questions