I have the following Code
Todos = Ember.Application.create();
Todos.Todo = Ember.Object.extend({
title: null,
isDone: false
});
Todos.TodosController = Ember.Object.extend({
// We need an array to hold our Todo objects
todos: Ember.A(),
init: function(){
debugger;
var items = this.get('todos');
items.addObject(Todos.Todo.create({title: "This is an Ember Item"}));
items.addObject(Todos.Todo.create({title: "This is another Ember Item"}));
},
remainingCount: function(){
return this.get('todos').filterProperty('isDone', false).length;
}.property('[email protected]')
});
Todos.controller = Todos.TodosController.create();
Todos.TodoView = Ember.View.extend({
templateName: 'todos'
});
</script>
I have the following handlebars hook defined inside the thml. But for some reason the template is not being rendered. When I inspect Handlebars.templates I see todos listed in the Object returned. What am I missing here.

Edit
Is it possible to define a template inside a .handlebars file at all ?
Edit
I did this inside app.js.
$.extend(Ember.TEMPLATES, Ember.TEMPLATES, Ember.Handlebars.templates);
But that didn't seem to help either. As you can see in the image below, the templates are now listed in Ember.TEMPLATES. But for some reason it is not picking them up.

Also I don't have any html between body tags. I am not sure if I should have anything there.
<body></body>
todos.handlebars. I compile them as a part of the build process. So a file named templates-compiled.js gets downloaded. - ShaggyInjunTodosControllerextendingEmber.ArrayControllerinstead ofEmber.Objectso you don't have to define atodosproperty and just usecontentinstead. This also brings several other features baked in the controller. Also note that using Handlebars in Ember is a little different than other frameworks. You should store your compiled templates inEmber.TEMPLATEScollection viaEmber.Handlebars.compile('your template')- MilkyWayJoeapplicationwhich is your layout. - MilkyWayJoeapplication. You'll load theTodosViewcalling the{{view}}helper or the{{outlet}}helper along the proper routes for your app, but it's required to have anapplicationtemplate. I strongly recommend that you read the guides. - MilkyWayJoe