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 7492989
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 29, 20262026-05-29T16:41:50+00:00 2026-05-29T16:41:50+00:00

I have a schema structured something like this: App = {}; App.Outer = Ember.Object.extend({

  • 0

I have a schema structured something like this:

App = {};

App.Outer = Ember.Object.extend({
    inner: null,
    quantity: 0,

    count: function () {
        var self = this, inner = self.get('inner');
        return self.get('quantity') * inner.get('count');
    }.property('nothing')
});

App.Inner = Ember.Object.extend({
    count: 0
});

Yes, the ‘count’ computed property really is set to depend on a totally nonexistent property ‘nothing’. However it seems to get updated anyway:

var o1 = App.Outer.create({
    quantity: 2,
    inner: App.Inner.create({count: 4})
});

console.log(o1.get('count')); // => 8
o1.get('inner').set('count', 5);
console.log(o1.get('count')); // => 10
o1.set('inner', App.Inner.create({count: 10}));
console.log(o1.get('count')); // => 20

Am I missing something? It knows what to update without me telling it what to depend on… can’t be right, can it? What am I misunderstanding about Ember computed properties?

Thanks

  • 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-05-29T16:41:51+00:00Added an answer on May 29, 2026 at 4:41 pm

    By using this.get('quantity'), inner.get('count') you are telling it what it depends on. Every time you call .get('count') the function will go off and get the current values for those properties and therefore return the up to date result.

    The .property() part comes into play when you bind the computed property count to something else e.g. a view. When you do that then making a change to quantity will automatically recalculate the count, and this new value will be propagated to whatever you have bound the count too.

    You can see the difference in action here: http://jsfiddle.net/tomwhatmore/6gz8x/

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

Sidebar

Related Questions

I have a schema like this <h1> 5/2009 <br/> Question: This is the question
While writing an XML schema, I am attempting to do something like this <xs:complexType
I have an existing table structure that looks something like this: AnimalTable ------------- |Id
I have a prefix trie. What is the recommended schema for representing this structure
I have this schema: <xs:complexType name=foo> <xs:sequence> <xs:element name=oneBar type=xs:string minOccurs=0/> <xs:element name=twoBar type=xs:string
I have this schema which I need to match 2 rows from user_data :
Can i get for example the node structure or something like this from the
Generally, MVC frameeworks have a structure that looks something like: /models /views /controllers /utils
Background I'm sketching on an application that needs to perform something like this database
I have some data in MongoDB that looks like this: { name: Steve, location:

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.