Closed zooshme closed 11 years ago
This is my code:
App = Ember.Application.create(); App.ApplicationView = Ember.View.extend();
App.Router = Ember.Router.extend();
App.Router.map(function() { });
var serializer = Ep.RestSerializer.extend();
App.Adapter = Ep.RestAdapter.extend({ namespace: 'api', serializer: serializer });
App.Post = Ep.Model.extend({ title: Ep.attr('string') });
App.IndexRoute = Ember.Route.extend({ model: function() { this.session.load('post') }, renderTemplate: function() { //console.log(this.session.load(App.Post)) this.render('index'); } });
I get these two errors in the Chrome console: Error while loading route: TypeError {} Uncaught TypeError: Cannot call method 'toString' of undefined
session.load requires an id (e.g. session.load('post', 1)). If you are trying to load all posts do a session.query('post').
session.load
session.load('post', 1)
session.query('post')
Thanks a lot.
This is my code:
App = Ember.Application.create(); App.ApplicationView = Ember.View.extend();
App.Router = Ember.Router.extend();
App.Router.map(function() { });
var serializer = Ep.RestSerializer.extend();
App.Adapter = Ep.RestAdapter.extend({ namespace: 'api', serializer: serializer });
App.Post = Ep.Model.extend({ title: Ep.attr('string') });
App.IndexRoute = Ember.Route.extend({ model: function() { this.session.load('post') }, renderTemplate: function() { //console.log(this.session.load(App.Post)) this.render('index'); } });
I get these two errors in the Chrome console: Error while loading route: TypeError {} Uncaught TypeError: Cannot call method 'toString' of undefined