Skip to content

Instantly share code, notes, and snippets.

View cilice's full-sized avatar

Alexander Plavinski cilice

  • 22:40 (UTC +01:00)
View GitHub Profile
myUserService.getUser = function(){
if(typeof(this.user) != "undefined"){
return this.user;
} else {
var promise = $http.get('/users/me')
.success(function(results, status){
if( (status!= 200) || (typeof(results) == "undefined") ){
alert('logged out!');
location.href = "/index.html";
}
myUserService.getUser = function(){
var promise = $http.get('/users/me')
.success(function(results, status){
if( (status!= 200) || (typeof(results) == "undefined") ){
alert('logged out!');
location.href = "/index.html";
}
this.user = results;
});