Very simple template
<script type="text/x-handlebars" data-template-name="win-edit-foot">
{{name}}
</script>
ContainerView class:
App.WinElementEditView = Em.ContainerView.extend({
classNames:['edit'],
childViews:['foot'],
foot:Em.View.extend({
templateName:'win-edit-foot',
name:'some name'
})
});
It doesn’t work, {{name}} in template replaced with “” (nothing)
The problem comes from your template. If you want the
nameproperty of the view, you have to replace{{name}}with{{view.name}}, according to View context changes.I suggest you to take a look at the Understanding the Ember.js view layer guide.
Here is the JSFiddle which does not work: [view
{{name}}, and the JSFiddle which works with{{view.name}}.