Warning: file_get_contents(/data/phpspider/zhask/data//catemap/2/ionic-framework/2.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
Javascript 离子与Firebase V.3认证_Javascript_Ionic Framework_Firebase_Firebase Realtime Database - Fatal编程技术网

Javascript 离子与Firebase V.3认证

Javascript 离子与Firebase V.3认证,javascript,ionic-framework,firebase,firebase-realtime-database,Javascript,Ionic Framework,Firebase,Firebase Realtime Database,我目前通过了firebase v3的应用程序项目,但我的身份验证系统不工作,我不明白为什么。这是我的密码: .controller('loginCtrl', function($scope) { $scope.loginEmail = function(){ firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) { va

我目前通过了firebase v3的应用程序项目,但我的身份验证系统不工作,我不明白为什么。这是我的密码:

.controller('loginCtrl', function($scope) {
        $scope.loginEmail = function(){
            firebase.auth().signInWithEmailAndPassword(email, password).catch(function(error) {
              var errorCode = error.code;
              var errorMessage = error.message;
            });
        };
    })
    .controller('signinCtrl', function($scope) {
        $scope.signupEmail = function(){  
            firebase.auth().createUserWithEmailAndPassword(email, password).catch(function(error) {
              var errorCode = error.code;
              var errorMessage = error.message;
            });
        };
    });
我的表格:

<form>
        <ion-list>
            <label class="item item-input">
                <span class="input-label">Username</span>
                <input type="text" placeholder="enter username..." ng-model="data.username">
            </label>
            <label class="item item-input">
                <span class="input-label">Email</span>
                <input type="email" placeholder="you@domain.com" ng-model="data.email">
            </label>
            <label class="item item-input">
                <span class="input-label">Password</span>
                <input type="password" placeholder="At least 6 characters" ng-model="data.password">
            </label>
        </ion-list>
        <button class="button button-stable button-block" ng-click="signupEmail()">Done</button>
    </form>

有人能帮我吗

我认为您应该初始化一封可变电子邮件,并将登录表单中的值存储在其中,然后再将其传递到firebase数据库。还要给它一个id,以便可以选择元素。对密码也做同样的操作

var email=document.getElementById('email').value;
var password=document.getElementById('password')。值

用户名
电子邮件
密码
多恩

这是工作!仍然有一些错误,但我正在努力!非常感谢你的帮助!这种初始化变量的方法是完全错误的,您不应该推荐这种方法
ReferenceError: email is not defined