neciu
neciu

Reputation: 4485

How to append bind-attr class to initial one in Ember?

How to append dynamic CSS class to initial static one using {{bind-attr}}?

When there is a static initial class, dynamic one is not added on page load. When I change variable during application run class binding works normally.

Here is a JSFiddle example.

Upvotes: 4

Views: 153

Answers (1)

Kalman
Kalman

Reputation: 8121

You need to use the following syntax:

<p {{bind-attr class=':bold isRed:red'}}>

See the Ember.js docs here, specifically where it says:

Bound class names and static class names cannot be combined.

Working example here

Upvotes: 3

Related Questions