Maybe I'm missing something, but I'm really confused as to why this isn't working:
// The Javascript
App.UsersView = Ember.View.extend({
templateName: 'user-list'
});
// The HTML
<script type="text/x-handlebars" data-template-name="user-list">
Hello World
</script>
Nothing is displaying?
(The application view displays so it's not a problem with the way ember.js is loaded. Just when trying to use custom views.)
The only view/template that is automatically appended to the dom is application. To include UsersView on the page, try:
<script type="text/x-handlebars" data-template-name="application">
<pre>application view</pre>
{{view App.UsersView}}
</script>
Working example here: http://jsbin.com/iluvik/1/edit
Typically the view helper is not necessary as most of the views/templates your application will get created by the ember router. Have a look at the Ember Routing Guide for a better understanding of how to wire things up.
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With