Semaphore/public/js/services/user.js

15 lines
275 B
JavaScript
Raw Normal View History

2014-08-24 19:36:34 +02:00
define([
'app'
], function(app) {
2014-08-25 12:35:49 +02:00
app.registerService('user', function($http, $rootScope) {
2014-08-24 19:36:34 +02:00
var self = this;
self.getUser = function(cb) {
$http.get('/profile').success(function(data) {
$rootScope.user = self.user = data.user;
cb();
});
}
});
});