emberjs/ember.js — Issue #387: parentView binding is not working with handlebars view helper
Author: jfgirard
Created: 2012-01-12 15:31:57+00:00
State: open

Hi,
In the master branch, the parentView binding from a handlebars template do not work anymore. I did a quick file compare and noticed a deleted line of code in `ember-handlebars/lib/helpers/view.js` : `if (!PARENT_VIEW_PATH.test(path)) {`

This line should take place after line 56.

if I put it back, binding start working again! I find it very useful to bind properties to parentView when I build complex template using subview.

For example, I built a select + input view like that:

{{#view KG.SelectInputView contentBinding="parentView.content" valueBinding="parentView.value"}}
{{view templateName="select" contentBinding="parentView.content" valueBinding="parentView.valueSelect"}}
{{view Ember.TextField valueBinding="parentView.valueInput" classBinding="parentView.inputClass"}}
{{/view}}

It can be re-used for many purposes.

Any idea why it has been removed ?

Thanks,

Jeff