0

I'm trying to use a EmberJS handlebar texture element and conditionally add a css class to it. Code looks like this:

{{textarea class={{if isBlue 'blue-css' 'green-css'}} }}

This does not work. The inner handlebars expression is inserted literally into the html, but I can use an html textarea:

<textarea class={{if isBlue 'blue-css' 'green-css'}} ></textarea>
How can I do this using an EmberJS handlebars expression, if at all? Thanks

1 Answer 1

2

You can try,

{{textarea classNameBindings="isBlue:blue-css:green-css"}}

as explained here docs

Sign up to request clarification or add additional context in comments.

1 Comment

Thank you. I'm still very new to EmberJS and just missed it.

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.