Javascript signInWithEmailAndPassword失败:第二个参数“password”必须是有效字符串

Javascript signInWithEmailAndPassword失败:第二个参数“password”必须是有效字符串,javascript,angularjs,Javascript,Angularjs,我正在尝试设置一个简单的身份验证。它在ionic 1.X中起作用,但在使用angularJs的Web应用程序中不起作用。它是相同的代码。不知为什么它不起作用。尝试添加但不起作用 这是我的密码 $scope.emailPassLogin=函数{ firebase.auth.signwith电子邮件和密码$scope.email$scope.pwd .功能反应{ console.logresponse; }.catchfunction错误{ //在这里处理错误。 $scope.error=错误;

我正在尝试设置一个简单的身份验证。它在ionic 1.X中起作用,但在使用angularJs的Web应用程序中不起作用。它是相同的代码。不知为什么它不起作用。尝试添加但不起作用 这是我的密码

$scope.emailPassLogin=函数{ firebase.auth.signwith电子邮件和密码$scope.email$scope.pwd .功能反应{ console.logresponse; }.catchfunction错误{ //在这里处理错误。 $scope.error=错误; $scope.message=error.message; }; }; 我在控制器中没有看到登录函数。我的angularjs有点生锈,但我认为您需要在用于组件的控制器中使用该命名函数。

ng Model应该是ng Model。它区分大小写。然后,您的2个html输入标记变为:

<input type="text" ng-model="email" class="form-control" placeholder="Adresse Email" required="" autofocus="">
<input type="password" ng-model="pwd" class="form-control" placeholder="mot de passe" required="">

我成功了,我就是这么做的

$scope.user1=[]; $scope.login=函数{ firebase.auth.signInWithEmailAndPassword$scope.user1.email$scope.user1.pwd .thenfunctionfirebaseUser{ console.logSigneds:+firebaseUser.uid; window.localStorage.setItememail、firebaseUser.email; }.catch函数错误{ console.errorauthenticated:+错误; }; } Se连接器
你忘了声明$scope.pwd吗?是的,我忘了我尝试了另一个函数。它仍然给我相同的结果,直到相同的结果result@RatedAce-在HTML中添加电子邮件:{{Email}

,以查看在键入输入时是否正在填充模型。对密码执行同样的操作。
<input type="text" ng-model="email" class="form-control" placeholder="Adresse Email" required="" autofocus="">
<input type="password" ng-model="pwd" class="form-control" placeholder="mot de passe" required="">