I'm seeing strange behavior when I attempt to access view elements from within a #with helper. Maybe this is expected, but looking through the Changelog for the latest Ember versions, I'm not finding anything that I expect to cause this behavior.
Here's my toy template:
{{#with model as "bar"}}
<label {{bind-attr for="view.inputField.elementId"}}>My Label</label><br/>
{{input type="text" viewName="inputField" valueBinding="bar"}}<br/><br/>
The id for the input field is {{view.inputField.elementId}}
{{/with}}
For Ember 1.6.1, the input field id is correctly displayed and the label's for attribute is set correctly.
For Ember 1.7.1, rendering fails entirely because "Uncaught Error: Assertion Failed: Cannot call get with 'inputField.elementId' on an undefined object"
For Ember 1.8.1, the page is rendered, but the input field id isn't displayed and the label's for attribute isn't set.
For Ember 1.9.0-beta.1 we're back to the behavior in Ember 1.6.1.
Here are jsbins for each ember version:
Ember 1.6.1 -- http://jsbin.com/lozape/4/edit
Ember 1.7.1 -- http://jsbin.com/xicove/1/edit
(I'm a SO noob, so I'll have to add my other jsbins in a comment, I guess)
What should I expect to be happening here? Is the behavior in 1.7 and 1.8 buggy, and a fix was put in for 1.9? Is there a workaround to get this to work correctly in 1.8?