I recreated the TodoMVC using EmberJS and after I was finished, I tried to change the ApplicationAdapter to FirebaseAdapter. But then the application stopped working and I am getting this error:
Error while loading route: undefined
Here are the version I am using
Ember : 1.5.0
Ember Data : 1.0.0-beta.7+canary.b45e23ba
Handlebars : 1.3.0
jQuery : 2.1.0
You can check out the code at github but here are some of the file contents.
With this code, it works
Todos.ApplicationAdapter = DS.FixtureAdapter.extend();
But when I change it to this, it stops working and I get the error:
Todos.ApplicationAdapter = DS.FirebaseAdapter.extend({
firebase: new Firebase('https://glaring-fire-8506.firebaseio.com')
});
I have the TodosController and TodoController, and this is my router file
Todos.Router.map(function () {
this.resource('todos', { path: '/' }, function () {
this.route('active');
this.route('completed');
});
});
Todos.TodosRoute = Ember.Route.extend({
model: function () {
return this.store.find('todo');
}
});
Todos.TodosIndexRoute = Ember.Route.extend({
model: function () {
return this.modelFor('todos');
},
renderTemplate: function (controller) {
this.render('todos/index', {
controller: controller
});
}
});
Todos.TodosActiveRoute = Todos.TodosIndexRoute.extend({
model: function () {
return this.store.filter('todo', function (todo) {
return !todo.get('isCompleted');
});
}
});
Todos.TodosCompletedRoute = Todos.TodosIndexRoute.extend({
model: function () {
return this.store.filter('todo', function (todo) {
return todo.get('isCompleted');
});
}
});
EDIT: when I added the todos JSON object to Firebase, it's working as it should. But I would really want to understand the problem.