2017-02-10 3 views
0

TypeError:Object.wo [as getResponse](recaptcha__en.js:302)でnullのプロパティ 'value'を読み込めません。$ scope.acessCode (コンパイル(angular.min.js:1)、:4:218)googe reCaptcha img.routerを使用しています。

+0

私はそのバグを4日以上修正することはできません。 –

+0

こんにちは、歓迎、StackOverflowへ。ヘルプページ、特に[ここではどのトピックについて聞かせていただけますか?](http://stackoverflow.com/help/on-topic)と[質問しないでください。」](http://stackoverflow.com/help/dont-ask)。さらに重要なことは、[Stack Overflow question checklist](http://meta.stackexchange.com/q/156810/204922)をお読みください。また、[最小、完全、および検証可能な例](http://stackoverflow.com/help/mcve)についても知りたいことがあります。 –

+0

問題の理解に役立つコードをいくつか追加してください。 –

答えて

0

ui.routerがウィジェットを再度読み込んで、vcRecaptchaServiceを呼び出すときに問題が発生していると思われます。 .getResponse();それがここで言及されたよう

https://github.com/VividCortex/angular-recaptcha/issues/81あなたのソリューションを作成するreCAPTCHAの関数を呼び出すときに作成するに

$scope.createCallback = function(widgetId){ 
     $scope.widgetId = widgetId; 
    }; 

次に、あなたのコントローラでコールバック関数を作成することです

getResponse() has a argument that must be passed to it, the widgetId, when multiple recaptcha widgets are registered/on the same page. Since you have a SPA, even though the first widget is no longer there, it is still registered in Google's code.

<div vc-recaptcha key="'key'" on-create="createCallback(widgetId)"></div> 

そして、あなたのコントローラーに戻って、tr応答を得るために

$scope.Response = vcRecaptchaService.getResponse($scope.widgetId); 
関連する問題