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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 17, 20262026-06-17T19:46:26+00:00 2026-06-17T19:46:26+00:00

Playing around with ember, I found that sometimes the model is stored on the

  • 0

Playing around with ember, I found that sometimes the model is stored on the controller’s content property, sometimes the model is directly available on the controller as well. I do not understand however, when this is the case.

Let me explain it by an example which I found when assembling my ember MVC.

Setup A – The start

  • I defined a custom Member object, corresponding MemberRoute, MemberView classes and a template with the name member.
  • The Member object had some attributes such as id, nickname, etc.
  • NOTE: no controller of the form MemberController was defined, thus by ember’s convention, it provides the controller on its own.

Setup B – The customization

  • Same as setup A, but now there is a MemberController defined that contains some action methods that are triggered from within the template.

The strange behaviour (resp. what I do not completely understand)

  • in setup A, I can refer to the Member‘s attributes directly with {{id}} or {{nickname}}.
  • in setup B, I have to use {{content.id}} or {{content.nickname}}

As documented in ember’s documentation, MemberView does

setupController : function(controller, member) {
    controller.set('content', member);
},

So, could somebody help me to understand why the difference and where the difference is? Currently, my guess would be either

  • that the context of the template is different (possibly there is a code piece missing in the setup of the controller?)

or

  • the default controller that is provided by ember automatically, has some additional magic that is not directly avaiable for customized controllers.

Any help to understand this is highly appreciated. It already took my quite a while to come as far as this. I first thought it could be the modularization introduced by the project setup with requireJS (well, I still think that could have a influence). Ember is v1.0pre4.

Thanks in advance!
Patrick

  • 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-17T19:46:27+00:00Added an answer on June 17, 2026 at 7:46 pm

    So, could somebody help me to understand why the difference and where the difference is? Currently, my guess would be either
    that the context of the template is different (possibly there is a code piece missing in the setup of the controller?)
    or
    the default controller that is provided by ember automatically, has some additional magic that is not directly avaiable for customized controllers.

    It’s hard to say for sure without seeing your code, but my best guess is that your MemberController extends Ember.Controller. The default provided by ember (in this scenario) would have been an Ember.ObjectController. If that’s what you want, change your MemberController definition to:

    App.MemberController = Ember.ObjectController.extend({
      myProperty: 'value'
    });
    

    An objectController acts as a proxy to it’s content property, typically that is an ember model. So if things are wired up correctly you should never need to access a model via the ‘content` property. If you ever see something like:

    {{content.id}} or {{content.nickname}}
    

    it’s a sign that you should change to an ObjectController. See EMBER GUIDES: REPRESENTING A SINGLE MODEL! for a more detailed explanation.

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

Sidebar

Related Questions

playing around with a property file i figured that there seems to be a
Whilst playing around with an nhibernate mapping, I noticed that a property setter I
Playing around with the ReadArgs package , it seems that it does not support
Playing around with MongoDB and NoRM in .NET. Thing that confused me - there
I'm playing around with ember.js and am stuck somehow finding out how to build
Just playing around and I found this. Why the call by reference to $this->newAxis()
Been playing around with thing's I've found over the weeks and I've decided to
While playing around with some hooks I noticed that the output from the hooks
Reading around and playing with what I've got, I've concluded that I'm on the
Playing around with xpath expressions trying to learn it. I found a code snippet,

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.