mercredi 25 février 2015

Complete Ember Login Demo - Injection Issue

I'm trying to teach myself Ember. I've seen very little complete demos on how to create an Ember App that checks for login status on load, and then allows a user to login and log out. The App should also have some basic permissions control (allow for public and private routes etc).


So far I've got the basics of the App up and running (big thanks to this). But I'm struggling with the login functions. The demo I have built has mock RESTful API responses, and returns the current user always (once I have that working, I'll figure out how the login form will work).


Q: Currently when the the App loads, it should get the logged in user (server will have a cookie set), and inject it into the routes and controllers. I have that working, but can't get the firstName, lastName of the current user inside the routes (they all come back undefined).


Take a look here: http://ift.tt/1BdAvit


Mock API response here: http://ift.tt/1A7D5Bb


I have the source code here: http://ift.tt/1BdAxH7





Aucun commentaire:

Enregistrer un commentaire