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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: June 5, 20262026-06-05T18:13:22+00:00 2026-06-05T18:13:22+00:00

I haven’t actually built an app yet, but I’m confused by documentation on bind-attr.

  • 0

I haven’t actually built an app yet, but I’m confused by documentation on bind-attr. It says you can do something like:

App.LogoView = Ember.View.extend({
  logoUrl: 'http://www.mycorp.com/images/logo.png'
});

With a template:

<div id="logo">
  <img {{bind-attr =logoUrl}} alt="Logo" />
</div>

To produce:

<div id="logo">
  <img src="http://www.mycorp.com/images/logo.png" alt="Logo" />
</div>

And Similarly:

App.AlertView = Ember.View.extend({
  priority: "p4",
  isUrgent: true
});

With a template:

<div {{bind-attr =priority}}>
  Warning!
</div>

To produce:

<div class="p4">
  Warning!
</div>

How does Ember know it was the src attribute in the first example and a class attribute in the second example? Unless I’m missing something here, this doesn’t seem like it’s really even possible.

  • 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-05T18:13:24+00:00Added an answer on June 5, 2026 at 6:13 pm

    The documentation appears to be wrong. Running the code as listed in the docs, I get the following error:

    Uncaught Error: Parse error on line 4:
    ...    <img {{bind-attr =logoUrl}} alt="Lo
    -----------------------^
    Expecting 'CLOSE', 'STRING', 'INTEGER', 'BOOLEAN', 'ID', 'SEP'
    

    Running the code as you would expect it to look works fine. You need to specify the attribute in question:

    <div id="logo">
        <img {{bind-attr src=logoUrl}} alt="Logo">
    </div>
    

    Here’s a working example (remove the attribute name and look for the error in the console).

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

Sidebar

Related Questions

I haven't actually done this yet, and maybe I don't need to, but it
I haven't found any documentation on this or seen this done before, but is
Haven't seen anything, but I have seen that you can create albums in the
haven't done much jquery and ran into a problem. I'd like to bind hover
I haven't yet worked out a specific case. But I am about to embark
Haven't done an app in a couple of years and I feel like I'm
Haven't found in docs. Does java ResultSet supports query arguments,like jdbcTemplate? For example, something
Haven't seen anything about it here but it seems to solve one of the
I haven't been able to find any documentation on Android's sync services, so far
I haven't been able to find any real documentation on this, so I'm wondering

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.