- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
I need help on the proper step to include ngCordova into my project. I'm using XDK with Ionic blank project as seed.
I tested Ionic and AngulaJS working without problem.
But when I try to include ngCordova, my AngularJS stop working. Please see the screenshot for easier understanding.
Please point me some light, what I did wrong? Please advice.
Please help! What I did wrong here?
- Tags:
- HTML5
- Intel® XDK
Link Copied
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello SithLord,
I tested move the app.js line to before body tag closing. Same error as seen below. I'm new to explore Angular and Ionic, so I didn't understand much what is this error mean. Do you have any idea? I can provide more info if you need. Thanks.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
you need to include ngRoute, angular.module('IonicApp', ['ionic', 'ngCordova', 'ngRoute'] and on your index.html
<script type="application/javascript" src="https://code.angularjs.org/1.3.15/angular-route.min.js"></script>
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hi, I tried do what you advice but it's the same result.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Mark Z. wrote:
Hi, I tried do what you advice but it's the same result.
Make sure you are using the current version of the core AngularJS library as well
<script type="application/javascript" src="https://code.angularjs.org/1.3.15/angular.min.js"></script> <script type="application/javascript" src="https://code.angularjs.org/1.3.15/angular-route.min.js"></script>
I added ng-cordova.min.js to my existing app and it broke my app with the same error. Including ngRoute resolved the problem for me so i dont know what else to try.
btw, my test was using ngCordova in a AFUI project not Ionic so its possible your issue is specific to ionic being in the mix and not just angular related.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hope someone else have idea on what is happening here. I tried your second advice, failed with same error.
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Are you able to share the code/project for people to look at?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
At a minimum, no pun intended, I would recommend loading the non-minimized version of ng-cordova.js so you can actually see and report what the error is.
Also, shouldn't the library code load ahead of your app code?
- Mark as New
- Bookmark
- Subscribe
- Mute
- Subscribe to RSS Feed
- Permalink
- Report Inappropriate Content
Hello everyone,
I fixed the problem by adding:
var app = angular.module('myApp', ['ionic', 'ui.router', 'ngCordova']);
ui.router instead of ngRoute. Fixed. Not sure which part cause the conflict yet.

- Subscribe to RSS Feed
- Mark Topic as New
- Mark Topic as Read
- Float this Topic for Current User
- Bookmark
- Subscribe
- Printer Friendly Page