![](/img/trans.png)
[英]angular.js:13920 TypeError: Cannot read property 'push' of null
[英]TypeError: Cannot read property 'value' of null in angular js
我在我的angular js應用程序中提交表單之前正在使用google recaptcha,並且第一次運行良好,但是如果我嘗試第二次提交表單(相同表單),則會顯示錯誤
angular.js:14525 TypeError: Cannot read property 'value' of null
我的驗證碼是
<div vc-recaptcha key="my key here" ng-model="letter.myRecaptchaResponse" on-create="setRecaptchaId(widgetId)"> </div>
我的控制器代碼是
$scope.setRecaptchaId = function(widgetId) {
$scope.recaptchaId = widgetId;
return;
};
$scope.letter.mresponse = vcRecaptchaService.getResponse($scope.recaptchaId);
實際上,如果我在第一次提交后刷新表單,一切都很好,對此感到很奇怪。 我從點擊這里獲得建議,但沒有任何解決方案。
第一組:
$scope.letter.myRecaptchaResponse = '';
在ng-init
。
聲明:本站的技術帖子網頁,遵循CC BY-SA 4.0協議,如果您需要轉載,請注明本站網址或者原文地址。任何問題請咨詢:yoyou2525@163.com.