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

  • SEARCH
  • Home
  • 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 7856967
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 2, 20262026-06-02T20:52:47+00:00 2026-06-02T20:52:47+00:00

Problem: the computed property tnop does not get updated when the controller modifies the

  • 0

Problem: the computed property “tnop” does not get updated when the controller modifies the “pages” array as shown below:

relevant book model code:

sections: []
tnop: function() 
{
var n = 0;
var sections = this.get('sections');
if (!sections)
  return n;

for (var i=0; i < sections.length; i++) {
  n += sections[i].pages.length;
}
return n;
}.property('sections.@each.pages.length')

relevant controller code:

var sections = EM.model.getPath('book.sections');
var aps = EM.model.getPath("ps");
$.each(sections, function(si, section) {
  var bp = [];
  if (json && json.ia) {
    bp = section.get("pages");
    var ns = aps[json.ssi];

      var lp = ns.get("lp");
      var rp = ns.get("rp");
    if (rp) {
      bp.insertAt(lp.number-1, rp);
      bp[lp.number-1] = rp;
    }
    if (lp) {
      bp.insertAt(lp.number-1, lp);
      bp[lp.number-1] = lp;
    }
  }
});

  • 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-02T20:52:49+00:00Added an answer on June 2, 2026 at 8:52 pm

    As it stands, you can’t observe deeply nested paths off @each directly. Instead, you have to use nested @each proxies, as such:

    property(‘sections.@each.pages.@each.length’)

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

In Chrome, the computed top property of an element may not be the same
I am having a really weird problem because i get completely different results between
Hi i get problem with xCode 4. I develope project with XCode4 on home
Problem: to see when computer makes approximation in mathematical calculations when I use Python
To solve some problem I need to compute a variant of the pascal's triangle
The problem is with respect to the writing speed of the computer (10 *
Problem : Five batch jobs A through E, arrive at a computer center at
Problem : Five batch jobs A through E, arrive at a computer center at
Recently I had a problem in a costumer's computer. Our installer would hang during
I can list my own computer's shares no problem with: gwmi Win32_Share But when

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.