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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 31, 20262026-05-31T15:35:34+00:00 2026-05-31T15:35:34+00:00

I am trying to migrated my app to using Ember-Data as it’s persistence mechanism.

  • 0

I am trying to migrated my app to using Ember-Data as it’s persistence mechanism. One thing that strikes me is that I’m not sure if it’s still possible to use an arrayProxy for aggregate properties of a hasMany association. In my previous iteration I didn’t have any explicit associations, just controllers tied together by specific properties. Now I’d like to take advantage of the association functionality in ember-data, but I am getting errors when I trie to bind the content of my array proxy to the “children” property of the DS.Model. My code is below and there is a jsfiddle here: http://jsfiddle.net/sohara/7p6gb/22/

The error I get is:

Uncaught TypeError: Object App.recipeController.content.ingredients has no method 'addArrayObserver'

I would like to be able to retain a controller layer, even if the data associations are controlleed at the model level. It’d also (ideally) like the child objects to be embedded in the json representation of the parent object in order to avoid multiple server requests.

window.App = Ember.Application.create();

App.store = DS.Store.create({
    revision: 3,
    adapter: DS.fixtureAdapter
});

App.Ingredient = DS.Model.extend({
    name: DS.attr('string'),
    price: DS.attr('string')
});

App.Recipe = DS.Model.extend({
    name: DS.attr('string'),
    ingredients: DS.hasMany('App.Ingredient', {embedded: true} )
});

 App.Recipe.FIXTURES = [
    {id: 1, name: 'Pizza', ingredients: [{id: 1, name: 'tomato sauce', price: 2, recipeId: 1}]}
 ];

App.recipeController = Ember.Object.create({
    content: App.store.find(App.Recipe, 1)
});

App.ingredientsController = Ember.ArrayProxy.create({
    content: 'App.recipeController.content.ingredients',

    totalWeigth: function() {
        var price = 0;
        items = this.get('content');
        items.forEach(function(item) {
            weight += price;
        });
    }.property()

});
  • 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-31T15:35:35+00:00Added an answer on May 31, 2026 at 3:35 pm

    In App.ingredientsController you need to have contentBinding: 'App.recipeController.content.ingredients', instead of content: ...

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

Sidebar

Related Questions

I'm trying to migrate a MySQL-based app over to Microsoft SQL Server 2005 (not
I'm trying to migrate my app from MySql to Postgresql, using Rails3-pre and the
I'm trying to migrate my app from cakephp 2.0 to 2.1. I've been using
I've got an app, that uses custom title feature. I'm trying to migrate it
I'm trying to migrate my Django app using South and am getting permission denied
I'm trying to debug an ASP.NET 3.5 app, which I've recently migrated from VS
I'm trying to migrate a website from Windows 2000 to Win2k3 using the IIS
I'm trying to migrate to JUnit 4 and I'm not clear about the correct
I'm trying to embed a ChartModule.aspx page within a Default.aspx page using an iframe
I have a jruby/rails app using: jruby 1.4.0 Rails 2.3.5 ActiveMQ 5.3.0 Mule ESB

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.