Skip to content
This repository was archived by the owner on Aug 17, 2021. It is now read-only.
This repository was archived by the owner on Aug 17, 2021. It is now read-only.

Feature request - Set site-key in a service provider instead of every view #98

@leosuncin

Description

@leosuncin

Maybe you can add the possibility to config "site key" in one place instead on every view in order to avoid a mistype error, by example:
app.js

angular.module('appName', ['vcRecaptcha'])
.config(['vcRecaptchaProvider', function(vcRecaptcha) {
  vcRecaptcha.setSiteKey('--Site key gos here--');
}]);

controller.js

angular.module('appName')
.controller('Controller', [
  '$scope',
  'vcRecaptchaService',
  function($scope, vcRecaptchaService) {
    $scope.submitForm = function() {
      var response = vcRecaptchaService.getResponse();
    }
  }
])

view.html

<form role="form" ng-submit="submitForm()">
  <div vc-recaptcha></div>
  <button type="submit">Send</button>
</form>

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions