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('todos.@each.isDone')
});
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>