Skip to content

Instantly share code, notes, and snippets.

@ddemid
Created April 11, 2014 13:26
Show Gist options
  • Save ddemid/10468787 to your computer and use it in GitHub Desktop.
Save ddemid/10468787 to your computer and use it in GitHub Desktop.
app.controller('LoginController', function($scope, $http, $location) {
$scope.login = function (){
$http.post('/accounts/login/', {
'email': $scope.email,
'password': $scope.password
})
.success(function(data, status, headers, config) {
$location.reload();
}).
error(function(data, status, headers, config) {
$scope.errors = data;
console.debug(data);
});
}
});
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment