我對Android的離子型應用程序,我想用ngCordovaOauth插件添加Facebook的登錄功能,但我得到:「ngCordovaOauth不可用」錯誤離子應用
0 851065 error Uncaught Error: [$injector:modulerr] Failed to instantiate module
starter due to:
Error: [$injector:modulerr] Failed to instantiate module ngCordovaOauth due to:
Error: [$injector:nomod] Module 'ngCordovaOauth' is not available! You either misspelled
the module name or forgot to load it. If registering a module ensure that you specify
the dependencies as the second argument.
....
我嘗試加載根據插件到here。我用亭子加載
bower install ng-cordova-oauth -S
然後,我添加行至的index.html
<script src="lib/ng-cordova-oauth/dist/ng-cordova-oauth.min.js"></script>
在此之後,插件,我添加的依賴於模塊app.js
angular.module('starter', ['ionic','ngMessages','ngCordova','ngCordovaOauth','ksSwiper','starter.services','starter.controllers'])
當我添加'ngCordovaOauth'時會出現錯誤。我也嘗試手動文件下載NG-科爾多瓦 - oauth.min.js並將其添加到www/js的文件夾,並添加
<script src="js/ng-cordova-oauth.min.js"></script>
到的index.html文件後,我通過亭子卸載。這也沒有奏效。我也嘗試刪除Android平臺,並再次添加它,並沒有工作。
我想我嘗試了一切,我可以做但似乎不起作用。它應該找到ngCordovaOauth但它不。任何幫助表示讚賞。
在此先感謝。
編輯
的index.html:
<head>
<meta charset="utf-8">
<meta http-equiv="Content-Security-Policy" content="default-src *; script-src 'self' 'unsafe-inline' 'unsafe-eval' *; style-src 'self' 'unsafe-inline' *">
<meta name="viewport" content="initial-scale=1, maximum-scale=1, user-scalable=no, width=device-width">
<title></title>
<link href="lib/ionic/css/ionic.css" rel="stylesheet">
<link href="lib/swiper/dist/css/swiper.min.css" rel="stylesheet"/>
<link href="css/style.css" rel="stylesheet">
<!-- IF using Sass (run gulp sass first), then uncomment below and remove the CSS includes above
<link href="css/ionic.app.css" rel="stylesheet">
-->
<!-- ionic/angularjs js -->
<script src="lib/ionic/js/ionic.bundle.js"></script>
<script src="lib/ngCordova/dist/ng-cordova.js"></script>
<script src="lib/swiper/dist/js/swiper.js"></script>
<script src="lib/angular-swiper/dist/angular-swiper.js"></script>
<script src="js/angular-messages.js"></script>
<script src="lib/ng-cordova-oauth/dist/ng-cordova-oauth.min.js"></script>
<!-- cordova script (this will be a 404 during development) -->
<script src="cordova.js"></script>
<!-- your app's js -->
<script src="js/app.js"></script>
<script src="js/services.js"></script>
<script src="js/controllers.js"></script>
你在哪裏試圖將腳本包含在index.html文件中? –
我編輯了問題 – gkocyigit
你安裝了什麼版本的ng-cordova? v0.1.24-alpha是修復了OAuth依賴性問題的版本。 –