Skip to content

Instantly share code, notes, and snippets.

@cseeger
Last active August 29, 2015 14:10
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save cseeger/74f8b49e3caab9f5514e to your computer and use it in GitHub Desktop.
Save cseeger/74f8b49e3caab9f5514e to your computer and use it in GitHub Desktop.
app.controller "LoginController", [
"$scope"
"$auth"
"UserService"
($scope, $auth, UserService) ->
$scope.init = ->
@clearErrors = ->
$scope.hasSystemError = false
return
@loginFailed = (response) ->
$scope.errors = response.data.errors
@loginWasSuccessful = (response) ->
UserService.getCurrentUser().then (user) ->
$scope.user = user
$state.go "whatedver"
$scope.init()
]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment