Semaphore/public/js/services/user.js

15 lines
267 B
JavaScript
Raw Normal View History

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