Hooking up Angular to Profile.jade

This commit is contained in:
terakilobyte
2015-01-06 00:52:30 -05:00
parent be22449d25
commit 41a1bc37c3
4 changed files with 25 additions and 15 deletions

View File

@ -145,12 +145,28 @@ exports.getAccount = function(req, res) {
title: 'Manage your Free Code Camp Account',
challenges: c,
ch: req.user.challengesHash,
moment: moment,
moment: moment
});
});
};
/**
* Angular API Call
*/
exports.getAccountAngular = function(req, res) {
Challenge.find({}, null, { sort: { challengeNumber: 1 } }, function(err, c) {
if (err) {
console.error('Challenge err: ', err);
next(err);
}
res.json({
user: req.user
});
});
};
/**
* GET /users/:username
* Public Profile page.