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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 9, 20262026-06-09T11:27:21+00:00 2026-06-09T11:27:21+00:00

/app.js var Welcome = Ember.Application.create({}); Welcome.person = Ember.View.extend({ personName: ‘Andrew’ }); Here is the

  • 0
/app.js    
var Welcome = Ember.Application.create({});

Welcome.person = Ember.View.extend({
    personName: 'Andrew'
});  

Here is the content of the index.html, part of the view:

/index.html
<!doctype html>
<!--[if lt IE 7 ]> <html lang="en" class="ie6"> <![endif]--> <!--[if IE 7 ]>    <html lang="en" class="ie7"> <![endif]--> <!--[if IE 8 ]>    <html lang="en" class="ie8"> <![endif]--> <!--[if IE 9 ]>    <html lang="en" class="ie9"> <![endif]-->
<!--[if (gt IE 9)|!(IE)]><!--> <html lang="en"> <!--<![endif]-->
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
  <title></title>
  <meta name="description" content="">
  <meta name="author" content="">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
</head>
<body>
<script type="text/x-handlebars">
  {{personName}}
</script>

<script src="js/libs/handlebars-1.0.0.beta.6.js"></script>
<script src="js/libs/ember-1.0.pre.min.js"></script>
<script src="js/app.js"></script>
</body>
</html>

My question is why isn’t it displaying anything? Shouldn’t it render the content of personName?

UPDATE:

I am using the Starter Kit from Ember. It already has a view defined. I just added one more property to the object but still it is not visible to the view.

App.MyView = Em.View.extend({
  mouseDown: function() {
    window.alert("hello world!");
  },
  name: 'Andrew'
});  

And the view part in .html is:

<script type="text/x-handlebars">
    {{#view App.MyView}}
      <h1>Hello world {{name}}!</h1>
    {{/view}}
  </script>  

Since the event works, isn’t the name supposed to be accessible?

  • 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-09T11:27:23+00:00Added an answer on June 9, 2026 at 11:27 am

    Since 1.0, the views preserve their context.

    VIEW CONTEXT CHANGES
    
    In apps built on earlier version of Ember (before 1.0), the {{#view}} helper
    created a new context for the view. This meant that you had to explicitly set the
    context on them.
    
    In 1.0, we've  made this a bit simpler. The {{#view}} helper no longer changes
    the context, instead  maintaining the parent context by default. Alternatively,
    we will use the controller  property if provided. You may also choose to directly
    overridethe context property. The order is as follows:
    
    Specified controller
    Supplied context (usually by Handlebars)
    parentView's context (for a child of a ContainerView)
    In the event that you do need to directly refer to a property on the view, you
    can use the view keyword, i.e. {{view.myProp}}.
    
    
    So, for your example, tou have to use {{view.name}}
    
    <script type="text/x-handlebars">
      {{#view App.MyView}}
        <h1>Hello world {{view.name}}!</h1>
      {{/view}}
    </script>
    
    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

Currently I have this code var App = Ember.Application.create(); App.user = Ember.Object.create({ people: customers
So I have an object of ArrayProxy kind var App = Ember.Application.create(); App.car =
Here is my app: var express = require('express'), app = express.createServer(), RedisStore = require('connect-redis')(express);
I've created a backbone view A and B : var App = { run:
If I do (for example) for (int i=0;i<22;i++) { var app = new Excel.Application();
Here is my attempt: function makeAllTextBlack() { var document = app.activeDocument, textFrames = document.textFrames,
I have the following node.js server-side code: var app = require('http').createServer(handler) , io =
I'm using the javascript module pattern, and have this so far: var APP; if(APP
object ReassignTest extends App { class X(var i : Int) def x = new
I have a command line app and have the code chdir(/var); FILE *scriptFile =

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.