9

I need to add css class to Ember.Select view:

{{view Ember.Select contentBinding="kpiTypes" valueBinding="model.amount" optionValuePath="content.value" optionLabelPath="content.name"}}

adding just class don't work

2 Answers 2

22

Use the classNames property:

{{view Ember.Select classNames="foo bar"}}
Sign up to request clarification or add additional context in comments.

2 Comments

worked! (can't accept answer in 7 minutes :) ) where i could learn how to customize views? (adding some events etc.)
emberjs.com/api/classes/Ember.View.html in the section RESPONDING TO BROWSER EVENTS
0

Sorry, I konw I'm really late. but this might save time for others who need help.

As Marcio said, you could use classNames if you want that as a static class to be added for your tag. If you need to bind a dynamic attribute as its class, we can make use of the classNameBindings keyword.

{{view Ember.Select contentBinding="App.algosController" selectionBinding="App.selectedAlgoController.algo" optionLabelPath="content.algoName" optionValuePath="content.id" classNameBindings="App.selectedAlgoController.algo.algoType"}}

Comments

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.