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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 13, 20262026-06-13T05:49:39+00:00 2026-06-13T05:49:39+00:00

I have a model: app.ObjectOne = Em.Object.extend({ id: null, count: null }); And another

  • 0

I have a model:

app.ObjectOne = Em.Object.extend({
    id: null,
    count: null
});

And another model, which computed property ‘SomeProperty’ I want to depend on property ‘count’ from ObjectOne

app.ObjectTwo = Em.Object.extend({
    id: null,
    someProperty: function(){
      return count+5;
    }.property('app.SomeObjectController.count')

});

So, can I do it that way?
Or is there any other way to do it;

The main idea is that data of ObjectOne model comes after ObjectTwo, so I what to recompute property and rerender view

  • 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-13T05:49:40+00:00Added an answer on June 13, 2026 at 5:49 am

    If I understand well, the behavior you want is exactly what Ember.js can bring to you.

    First, here is a very basic template:

    <script type="text/x-handlebars">
      Here, the template is updated each time this property is updated (equivalent to bound property)
      {{App.objectTwo.someProperty}}
    </script>​
    

    Here is the javascript. I don’t know if you really want to use an ObjectController here, but you mention it, so I have use it. An ObjectController’s act as a proxy around it’s content property. That means here that someObjectController.get(‘count’) will try to get the count property from the controller itself, and if it does not exist, then the controller retrieve the count property from its content.

    App = Ember.Application.create();
    App.someObjectController = Ember.ObjectController.create();
    
    App.ObjectOne = Em.Object.extend({
      id: null,
      count: null
    });
    App.objectOne = App.ObjectOne.create({
      id: 1,
      count: 42
    });
    App.someObjectController.set('content', App.objectOne);
    
    App.ObjectTwo = Ember.Object.extend({
      id: null,
      someProperty: function(){
        return App.someObjectController.get('count')+5;
      }.property('App.someObjectController.count')
    });
    App.objectTwo = App.ObjectTwo.create({
      id: 1
    });
    
    //in 3 seconds the count property is set to 0. You can see the template is updated
    Ember.run.later(function(){
       App.objectOne.set('count', 0);
    },3000);
    

    Here is the working jsfiddle: http://jsfiddle.net/Sly7/M3727/4/

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

Sidebar

Related Questions

In my Rails app, I have a model Page which represents one HTML article
I have an app objects and image objects which are linked to one another
Say I have the following ember-data model: App.Person = DS.Model.extend({ firstName: DS.attr('string'), lastName: DS.attr('string'),
I have a model app which has many to many association with users. Here
I have a simple test case failing in Django: Model (app/models.py): from django.db import
I have this code App.Model('users').find(function (err, users) { users.forEach(function(user) { console.log(user.username); }); }); //make
I have a Comment model in my app but am encountering a lot of
I have a model called Customer in google app engine with python: class Customer(db.Model):
I have an Entity Data Model-based app that uses SQL Server CE 3.5 as
In my Rails 3.2.6 app, I have a model representing a collection of data

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.