Hello,

I'm newbie in angularJS.

I would like create service for authentifiation.
The function isConnected shoud be return true or false if user is 
authentified.
How check code http status ?

app.service("authService", function($rootScope, $http, $resource) {
return {
isConnected : function() {
var auth = $resource('/api/auth').get();
if (auth.code.status === 200) { // how check  status http
return true
}
return false;
},
logIn : function() {
// ...
$rootScope.$broadcast("connectionStateChanged");
},
logOut : function() {
// ...
$rootScope.$broadcast("connectionStateChanged");
}
};
});

Stephane

-- 
You received this message because you are subscribed to the Google Groups 
"Angular and AngularJS discussion" group.
To unsubscribe from this group and stop receiving emails from it, send an email 
to [email protected].
To post to this group, send email to [email protected].
Visit this group at https://groups.google.com/group/angular.
For more options, visit https://groups.google.com/d/optout.

Reply via email to