I can not get my head around this. I have started from this jsfiddle (a showcase for image preview + upload), which is working with ember-0.9.8.1, and I am trying to get it working with ember-1.0.0-rc.6 in this jsbin.
This is the relevant part causing problems:
<script type="text/x-handlebars">
{{#view Ember.View contentBinding="App.myModel"}}
{{#view App.PreviewUploadImage name="logo_image" contentBinding="content"}}
{{view fileField}}
{{view previewImageView width="200" height="100" srcBinding="content.myModel_src"}}
{{/view}}
{{/view}}
</script>
Together with this js:
App.PreviewUploadImage = Ember.View.extend({
fileField: Ember.TextField.extend({...}),
});
As you can see in the console errors:
Assertion failed: Unable to find view at path 'fileField'
Assertion failed: You must pass a view to the #view helper, not fileField ()
Uncaught TypeError: Cannot read property 'proto' of undefined
But fileField is a Ember.TextField (so indeed a view) and is defined in the context where it is used (the view PreviewUploadImage).
So where is the problem then?