我刚刚使用--save下载了带有NPM的geolib,当我尝试使用它时,我收到了:
未捕获的ReferenceError:未定义geolib
在JS控制台中。之后我添加了一个脚本来指向我的index.html文件中正确的控制器中的.js文件。我还检查了我的package.json,它作为依赖项存在。最后,我将一个版本复制并粘贴到我的bower_components文件夹中。我还需要做些什么来让我的项目积极地认识到它?
请求的完整错误:
Uncaught ReferenceError: geolib is not definedoffer.controller.js:186 $scope.consumerMatch.userTableQuery.get.success.cMatch.find.success.mMatch.find.successparse.js:4022 (anonymous function)parse.js:3895 _.extend.then.wrappedResolvedCallbackparse.js:3839 (anonymous function)parse.js:95 _.each._.forEachparse.js:3838 _.extend.resolveparse.js:3905 _.extend.then.wrappedResolvedCallbackparse.js:3839 (anonymous function)parse.js:95 _.each._.forEachparse.js:3838 _.extend.resolveparse.js:3905 _.extend.then.wrappedResolvedCallbackparse.js:3839 (anonymous function)parse.js:95 _.each._.forEachparse.js:3838 _.extend.resolveparse.js:3900 (anonymous function)parse.js:3895 _.extend.then.wrappedResolvedCallbackparse.js:3957 (anonymous function)parse.js:3940 _.extend.then.runLaterparse.js:3956 _.extend.thenparse.js:3899 _.extend.then.wrappedResolvedCallbackparse.js:3839 (anonymous function)parse.js:95 _.each._.forEachparse.js:3838 _.extend.resolveparse.js:1536 Parse._ajax.xhr.onreadystatechange