Yes, I like that much better.

On Tue, Jan 7, 2014 at 9:32 AM, hathym <[email protected]> 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.
>



-- 
R. Mark Volkmann
Object Computing, Inc.

-- 
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.

Reply via email to