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

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 28, 20262026-05-28T01:54:34+00:00 2026-05-28T01:54:34+00:00

Using the already-overused to-do app example, let’s say I want an element with a

  • 0

Using the already-overused to-do app example, let’s say I want an element with a “todo” class (static) and an “is-done” class (dynamic):

<div {{bindAttr class="todo isDone"}}>
  Other stuff in here
</div>

In this case, “isDone” and “todo” are both expected to be properties on my view object, which is what I want for “isDone”, but not for “todo”. I’m currently working around this by adding a “todo” property on my view that is equal to a static “todo” string. Is there any way to have a static class attribute when using bindAttr?

Fiddle example: http://jsfiddle.net/nes4H/4/

  • 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-05-28T01:54:34+00:00Added an answer on May 28, 2026 at 1:54 am

    EDIT:

    We’ve fixed this in Ember!

    On a build from master, or after 0.9.6 is released, you can now do:

    <div {{bindAttr class="App.foo:a-bound-class :a-static-class"}}></div>


    Previous answer:

    You unfortunately can’t have both static and dynamic class names when using bindAttr.

    I suggest using one or more computed properties on your view to output both static and dynamic class names.

    Supporting both static and dynamic class names would be very nice, but the way bindAttr currently works, it’s not possible. bindAttr doesn’t know anything about the element it’s being attached to during template compilation.

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

Sidebar

Related Questions

I've done this already using TCP/IP. I am now trying to do this using
I have an element where I'm already using the rel attribute, but I would
I have a Node.js Express app that I'm hosting on Nodejitsu. I'm already using
I am already using this example of how to read large data files in
I'm already using http://php.net/pdo so I can get whatever I want from the user
I want to make a loop using an already-defined iterator. At present I am
I am currently trying to implement a serial port reader class using Windows (already
I'm generating a dynamic assembly using Reflection.Emit which includes a single class. I have
I am trying to assemble a scene in opengl, using already made objects. The
I'm already using salted hashing to store passwords in my database, which means that

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.