just noticed that the video next to the example is doing it right with the
filter function.
On Tuesday, January 7, 2014 4:32:48 PM UTC+1, hathym wrote:
>
> From this:
>
>
> 1. $scope.archive = function() {
> 2. var oldTodos = $scope.todos;
> 3. $scope.todos = [];
> 4. angular.forEach(oldTodos, function(todo) {
> 5. if (!todo.done) $scope.todos.push(todo);
> 6. });
> 7. };
>
>
> To this
>
>
> 1. $scope.archive = function() {
> 2. $scope.todos = $scope.todos.filter(function(element){
> 3. return !element.done;
> 4. });
> 5. };
>
>
>
> I think the second example is much more simple! any thought?
>
>
>
--
You received this message because you are subscribed to the Google Groups
"AngularJS" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to [email protected].
To post to this group, send email to [email protected].
Visit this group at http://groups.google.com/group/angular.
For more options, visit https://groups.google.com/groups/opt_out.