0

我正在使用处理注册和登录/注销的 $ionicAuth 服务。我按照本教程https://docs.ionic.io/services/auth/#emailpassword-authenticationhttps://docs.ionic.io/setup.html - 设置离子云和使用服务。当我尝试注册时,我收到此错误 - $ionicAuth.signup 不是函数。请帮我解决这个问题。

$scope.register = function(){

        $scope.error = '';
        $ionicAuth.signup($scope.registerData).then(function() {
            // `$ionicUser` is now registered
            $ionicAuth.login('basic', $scope.registerData).then(function(){
              $state.go('login');
            });
        }, function(err) {

            var error_lookup = {
                'required_email': 'Missing email field',
                'required_password': 'Missing password field',
                'conflict_email': 'A user has already signed up with that email',
                'conflict_username': 'A user has already signed up with that username',
                'invalid_email': 'The email did not pass validation'
            }

            $scope.error = error_lookup[err.details[0]];
        })
    }
4

0 回答 0