javascript - Cannot set attributeBindings to property on View's ObjectController in Ember -


i managed set attributebinding controller context through handlebars template:

<li {{bindattr class="view.controller.isselected:active:"}}>     <a href="#" {{action "toggleselected"}}>{{view.controller.title}}</a> </li> 

which called within each group this:

<ul class="nav nav-tabs nav-stacked">     {{#each skill in controller}}         {{view app.skillview}}     {{/each}} </ul> 

but found emberjs adding divs around each view causing problems css removed li tags template , set tagname in skillview , attempted attributebinding through js object adds li dom element want attributebindings using doesn't seem work:

app.skillview = ember.view.extend({     templatename: 'skill',     tagname: 'li',     attributebindings: ['controller.isselected:active:'] }); 

nor this:

app.skillview = ember.view.extend({     templatename: 'skill',     tagname: 'li',     attributebindings: ['view.controller.isselected:active:'] }); 

nor this:

app.skillview = ember.view.extend({     templatename: 'skill',     tagname: 'li',     attributebindings: ['isselected:active:'] }); 

how reference controller within view in context of view binding string? doing on handlebars template not doing in view code?

it turned out should have been using classnamebindings instead of attributebindings. following worked:

app.skillview = ember.view.extend({     templatename: 'skill',     tagname: 'li',     classnamebindings: ['controller.isselected:active:'] }); 

Popular posts from this blog

How to calculate SNR of signals in MATLAB? -

c# - Attempting to upload to FTP: System.Net.WebException: System error -

ios - UISlider customization: how to properly add shadow to custom knob image -