Created
September 30, 2015 20:09
-
-
Save RubyRonin/604f058993ffb8d2f6b5 to your computer and use it in GitHub Desktop.
user.signup function question
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
.controller('LoginCtrl', function($scope, $state) { | |
$scope.data = {}; | |
$scope.signupEmail = function(){ | |
//Create a new user on Pasre | |
var user = new Parse.User(); | |
user.set("username", $scope.data.username); | |
user.set("password", $scope.data.password); | |
user.set("email", $scope.data.email); | |
user.signUp(null, { | |
success: function(user) { | |
alert("sucess!"); | |
$state.go('dashboard'); //causes app to change "state" or "view" upon success, required the injection of $state | |
}, | |
error: function(user, error) { | |
alert("Error: " + error.code + " " +error.message); | |
} | |
}); | |
}; |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment