Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error when loading deep link with live data #9

Open
scottjbarr opened this issue Apr 25, 2014 · 1 comment
Open

Error when loading deep link with live data #9

scottjbarr opened this issue Apr 25, 2014 · 1 comment

Comments

@scottjbarr
Copy link

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 ?

@morgansamson
Copy link

Has anyone been able to figure this out?

I think I'm in a slightly similar boat - trying to integrate the live data just breaks my app. It doesn't even load any elements, just returns a white screen.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants