javascript - TypeError: Cannot read property 'value' of null in angular js -


i using google recaptcha before form submit in angular js application , working fine first time if try submit form second time(same form) showing error
angular.js:14525 typeerror: cannot read property 'value' of null

my recaptcha code

<div vc-recaptcha key="my key here" ng-model="letter.myrecaptcharesponse" on-create="setrecaptchaid(widgetid)"> </div>  

my controller code

$scope.setrecaptchaid = function(widgetid) {     $scope.recaptchaid = widgetid;     return; }; $scope.letter.mresponse = vcrecaptchaservice.getresponse($scope.recaptchaid); 

actually if refresh form after first submit working fine, feeling strange it. took suggestions click here nothing solved issue.

first set:

$scope.letter.myrecaptcharesponse = ''; 

within ng-init.


Comments

Popular posts from this blog

javascript - WinJS appendTextAsync producing scheduler errors -

minify - Minimizing css files -

Sockets with kotlin -