我正在使用AngularJS使用Parse后端创建用户配置文件注册。但是,在我的控制台上,我收到错误,说Parse未定义。我怎样才能使它工作并将新用户插入数据库?
以下是我的代码:
.controller('reg',['$scope',function($scope, $state, $rootScope){
$scope.signUp = function() {
var user = new Parse.User();
user.set("email", $scope.user.email);
user.set("password", $scope.user.password);
user.set("firstname", $scope.user.firstname);
user.set("lastname", $scope.user.lastname);
user.signUp(null, {
success: function(user) {
$rootScope.user = user;
$state.go('home');
},
error: function(user, error) {
alert("error here");
}
});
};
}])