Semaphore/public/js/services/user.js
2014-08-25 11:35:49 +01:00

15 lines
275 B
JavaScript

define([
'app'
], function(app) {
app.registerService('user', function($http, $rootScope) {
var self = this;
self.getUser = function(cb) {
$http.get('/profile').success(function(data) {
$rootScope.user = self.user = data.user;
cb();
});
}
});
});