Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • Home
  • SEARCH
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 8899149
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 15, 20262026-06-15T00:47:24+00:00 2026-06-15T00:47:24+00:00

On the Ember MVC TodoApp there is an option Clear all Completed. I’ve been

  • 0

On the Ember MVC TodoApp there is an option “Clear all Completed”.

I’ve been trying to do a simple “Clear All”.

I’ve tried multiple things, none of them work as I expected (clearing the data, the local storage and refreshing the UI).

The ones that comes with the sample is this code below:

clearCompleted: function () {
    this.filterProperty(
            'completed', true
        ).forEach(this.removeObject, this);
},

My basic test, that I expected to work was this one:

  clearAll: function () {
            this.forEach(this.removeObject, this);
        },

Though, it’s leaving some items behind.

If I click the button that calls this function in the Entries controller a couple times the list ends up being empty. I have no clue what’s going on! And don’t want to do a ‘workaround’.

The clearCompleted works perfectly by the way.

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-06-15T00:47:26+00:00Added an answer on June 15, 2026 at 12:47 am

    The answer depends on what you really want to know– if you want to clear an ArrayProxy, as per the question title, you just call clear() on the ArrayProxy instance e.g.:

    var stuff = ['apple', 'orange', 'banana'];
    var ap = Ember.ArrayProxy.create({ content: Ember.A(stuff) });
    ap.get('length'); // => 3
    ap.clear();
    ap.get('length'); // => 0
    

    This way you’re not touching the content property directly and any observers are notified (you’ll notice on the TodoMVC example that the screen updates if you type Todos.router.entriesController.clear() in the console).

    If you’re specifically asking about the TodoMVC Ember example you’re at the mercy of the quick and dirty “Store” implementation… if you did as above you’ll see when you refresh the page the item’s return since there is no binding or observing being done between the entry “controller” and the Store (kinda dumb since it’s one of Ember’s strengths but meh whatev)

    Anywho… a “clearAll” method on the entriesController like you were looking for can be done like this:

    clearAll: function() {
        this.clear();
        this.store.findAll().forEach(this.removeObject, this);
        }
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

There are a lot of Javascript MVC frameworks available these days (Backbone.js, Cappuccino, Ember.js,
Stackoverflow is built on MVC and does a bunch of simple but nice things
There is a simple ember.js app with one view displayed in a particular place
With ember-data I'm loading all records of a model with: App.adapter = DS.Adapter.create({ findAll:
I have a very simple MVC app at this point: Controller: public class HomeController
I'm developing an application using ember.js and a rest API written with spring MVC.
I am newbie in client side Javascript MVC, first ember.js app. I follow the
I'm trying to embed svg images in Views in an Asp.Net MVC 3 application,
I spent all day yesterday looking for a text editor for my Asp.Net MVC
Considering the most popular MVC/MVVM client-side patterns (like Knockout.js , Angular.js , Ember.js ,

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.