Created
January 17, 2016 21:50
-
-
Save miyamotodev123/02a54ade5646b0d12bf2 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
(function() { | |
angular.module('app') | |
.controller('SignupController', ['$http', '$location', | |
function($http, $location) { | |
var vm = this; | |
vm.signup = function() { | |
$http | |
.post('/signup', { | |
email: vm.email, | |
password: vm.password | |
}) | |
.success(function(response) { | |
console.log(response); | |
$location.path(response.redirect) | |
}) | |
.error(function(error) { | |
console.log('failed login'); | |
console.log(error); | |
}) | |
} | |
}]) | |
})(); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment