Created
August 5, 2014 03:51
-
-
Save gocreating/070b1ab4f2ea40c5e9c5 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// service.js | |
.factory('authService', ['$http', '$route', function ($http, $route) { | |
var auth = { | |
isAuth: false, | |
user: null | |
}; | |
$http | |
.get('/api/session') | |
.success(function (data) { | |
auth.isAuth = data.value.isAuth; | |
auth.user = data.value.user; | |
$route.reload(); | |
}); | |
return auth; | |
}]) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment