TypeError:$ ionicAuth.signup不是函数

时间:2017-03-13 14:21:02

标签: ionic-framework ionic-cloud ionic-auth-service

我正在使用$ 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]];
        })
    }

0 个答案:

没有答案