简体   繁体   English

“找不到变量:cordova”

[英]"Can't find variable: cordova"

I'm trying to import some plugins, in order to use them onto my Cordova application.我正在尝试导入一些插件,以便在我的 Cordova 应用程序中使用它们。 After doing some tests, I got stuck at the following error from the debugger on my web browser console (served by ionic):在进行了一些测试后,我在 Web 浏览器控制台(由 ionic 提供)上的调试器中遇到了以下错误:

Can't find variable: cordova signup@ http://localhost:8100/js/controllers.js:223:32找不到变量:cordova s​​ignup@ http://localhost:8100/js/controllers.js:223:32

And this is the line corresponding to the error:这是与错误对应的行:

var Sim_plugin = cordova.require("cordova/plugin/sim"); var Sim_plugin = cordova.require("cordova/plugin/sim");

I tried to search everywhere about the problems related to this issue: But didn't yet find any solution that might solve my problem.我试图到处搜索与此问题相关的问题:但还没有找到任何可能解决我的问题的解决方案。

I need some help.我需要帮助。

Thank you.谢谢你。

Did you include cordova.js in your index.html ?是否index.html 中包含了cordova.js

<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>

And you have to inject ionic into your angular app你必须在你的 angular 应用程序中注入ionic

var app = angular.module('yourApp', ['ionic']);

声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.

 
粤ICP备18138465号  © 2020-2024 STACKOOM.COM