Open
Description
If you switch to using live data as the video shows, when you hit a "deep link" directly rather than navigating to it, you get an error.
Per the video, change the post route to...
App.PostsRoute = Ember.Route.extend({
model: function() {
return $.getJSON('http://tomdale.net/api/get_recent_posts/?callback=?').then(function(data) {
return data.posts.map(function(post) {
post.body = post.content;
return post;
});
});
}
});
Now go direct (don't navigate via the UI) to /index.html#/posts/875
You will see the following error in the console...
Error while loading route:
ReferenceError {stack: (...), message: "posts is not defined"}
I thought that posts was a Promise?
How do you get around this in Ember.js ?
Metadata
Metadata
Assignees
Labels
No labels
Activity