app service AuthService Users window function Users window var self th

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
app.service('AuthService', ['Users', '$window', function (Users, $window) {
var self = this;
self.updateCurrent = function () {
self.user = Users.current();
return self.user
};
self.updateCurrent();
self.currentUser = function () {
return self.user;
};
self.signOut = function (){
$window.location = '/accounts/logout/';
};
}]);