cordovaHTTP未定义

时间:2016-06-27 07:07:50

标签: angularjs cordova ionic-framework cordova-plugins

我正在使用HTTP请求。

我使用过这个插件:

https://github.com/panta/cordova-HTTP

angular.module('starter', ['ionic', 'starter.controllers', 'starter.services','ngCordova','ja.qr','ngStorage','ngCordovaHTTP'])

.run(function($ionicPlatform,$rootScope,$localStorage) {
  $ionicPlatform.ready(function() {
    // Hide the accessory bar by default (remove this to show the accessory bar above the keyboard
    // for form inputs)

    console.log(cordovaHTTP);

但它引发了一个错误:

  

cordovaHTTP未定义

在index.html中

<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="js/ng-cordova-http.js"></script>

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

1 个答案:

答案 0 :(得分:0)

cordovaHTTP不是插件符号的正确命名,&#34; CordovaHttpPlugin&#34;是正确的,并在窗口对象中定义。