【发布时间】:2020-08-18 22:14:01
【问题描述】:
我正在尝试将 Google reCaptcha v2 添加到我的 AngularJS 应用程序中。我正在尝试使用 VividCortex 的 angular-recaptcha,但我无法将依赖项添加到我的应用程序模块中。
我的模块的原始代码是这样的:
angular.module("myApp")
.config(['$httpProvider','jwtInterceptorProvider', function Config($httpProvider, jwtInterceptorProvider) {
//do stuff
}])
.config([ '$routeProvider', '$httpProvider', function($routeProvider, $httpProvider) {
//do other stuff
}])
.factory('httpRequestInterceptor', ['API_KEY', function(API_KEY) {
//do more stuff
}]);
我一直在尝试像在文档中一样添加依赖项:
angular.module("myApp", ['vcRecaptcha'])
但它给了我这个错误:
未捕获的错误:[$injector:modulerr] 无法实例化模块 myApp,原因如下: 错误:[$injector:unpr] 未知提供者:jwtInterceptorProvider
如果我不尝试添加依赖项,我不会收到此错误。
提前致谢!
【问题讨论】: