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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 18, 20262026-06-18T14:20:55+00:00 2026-06-18T14:20:55+00:00

I am using ember and handlebars for template and I have a case where

  • 0

I am using ember and handlebars for template and I have a case where I need to give custom Ids to the element which is created using loops.
Something like:

{{#each item in list}}
    <li {{bindAttr id="item.id"+item.name}}>item.text</li>
{{/each}}

i wanted my id to be a sum of strings id and name. e.g. if

id = 3 and name = summary 

then it should render as

<li id="3summary">Summary</li>
  • 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-18T14:20:56+00:00Added an answer on June 18, 2026 at 2:20 pm

    You can’t concatenate in Handlebars like that, instead you’ll need to either create a Handlebars helper to do that, or create a computed property in the Ember.Object:

    App.MyModel = Ember.Object.extend({
        idName: function() {
            return '%@%@'.fmt(this.get('id'), this.get('name').toLowerCase());
        }.property('id', 'name')
    });
    

    Please see the JSFiddle for a working example: http://jsfiddle.net/u4th3/

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

Sidebar

Related Questions

Using: ember: v1.0.0-pre.4 ember-data: revision 11 handlebars: 1.0.rc2 So I have a template that
I'm using Ember.js with handlebars and I need to make a div within my
I have a Ember.Select View, using which I can bind an Array of contents
I'm using Ember.js and I'm trying to have a div element with two different
I am trying to learn Ember using the docs here: http://emberjs.com/guides/templates/handlebars-basics/ I am following
I am have difficulty setting a belongsTo relationship using ember data. I have a
i have a script handlebar.. <script id=ownerItem data-template-name='ownerItem' type=text/x-handlebars> {{value.UserName}} &nbsp;<button {{action remove on=click}}>Remove</button>
Using Ember js, I've got a tree-based structure of views, each of which has
I am trying to add an ember view using handlebars.js in jade. When I
I have the following handlebars template (fragment): {{#each cbe in abs.XyzBookingEntries}} <tr> {{#if cbe.isLoaded}}

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.