This is one of those things that should be easy and it’s probably obvious to most people but it threw me for a while.
I wanted to pass a value into my ember.js view at the moment that I declare the view. It’s a static value, just a css class
name, so it doesn’t need to be bound to anything. Turns out it’s really not that hard:
Add a property to your view:
App.ModalView = Ember.View.extend({ aClassName: 'modal' }); </pre>
When you use the view just set the property:
{{#view App.ModalView aClassName="wide_modal"}} Some great content goes here {{/view}} </pre>
Use the value in your template:
<div {{bindAttr class="view.aClassName"}}> More stuff here </div> </pre>