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

  • Home
  • SEARCH
  • 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 9239953
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T08:06:21+00:00 2026-06-18T08:06:21+00:00

I guess this is simple but as an Ember newbie I cannot find a

  • 0

I guess this is simple but as an Ember newbie I cannot find a solution…

So let’s say I have this very simple view:

MyApp.MyTextView = Ember.View.extend({
    template: Ember.Handlebars.compile('{{value}}')
});

And I want to use this view in order to display two different properties of the same object. This sounds like I want to add parameters when I ‘call’ my view.
In a second view I want to be able to do something like the following (supposing my content object is a Person : {firstName: ‘toto’, lasName: ‘titi’}):

MyApp.AnotherView = Ember.View.extend({
    template: Ember.Handlebars.compile('FirstName: {{view MyApp.MyTextView value="content.firstName"}} - LastName: {{view MyApp.MyTextView value="content.lastName"}}')
});

I also tried to use Handlebars helpers as explained here, but It does not work (when I use {{highlight firstName}} or {{highlight content.firstName}} what is displayed is firstName or content.firstName, not the property value…)

Do you guys have any idea? I’m stuck here…

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-06-18T08:06:22+00:00Added an answer on June 18, 2026 at 8:06 am

    To pass in parameters to your view, you can specify each one like so:

    {{view App.MyView firstNameBinding="content.firstName" lastNameBinding="content.lastName"}}
    

    Which would allow you to do:

    template: Ember.Handlebars.compile('{{view.firstName view.lastName}}');
    

    However, you can imagine that this will get very long as you add more properties. Therefore you can instead simply pass in your content object as the context (but you don’t need to pass it in as context — although that’s for another day):

    {{view App.MyView contextBinding="content"}}
    

    (Please note that contextBinding is special, and changes the context in the view.)

    That way the view will hold the object you pass in, and so in your view you can now do:

    template: Ember.Handlebars.compile('{{firstName lastName}}');
    

    (You can do it like this because content is now your view’s context.)

    I’ve knocked you up a quick JSFiddle to elucidate (hopefully!): http://jsfiddle.net/YVCrq/

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

Sidebar

Related Questions

I guess this is a quite simple (read: very simple) question, but I have
I guess this is simple, but i couldnot figure it out. i have a
I guess there will be a very simple answer to this. But here goes.
This should be simple but I guess I'm hitting a mental block- I have
This question can be very simple but could not find the answer; I receive
I thought this might be simple but i guess it's not, i have like
I guess this is a very simple question, but I am spending more time
I guess this is fairly simple for you but i cant wrap my head
This is a simple question,I guess, but I couldn't figure it out. How do
I guess this is kind of an odd question but I have tried setting

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.