How to user ngCordova with Ionic creator


I am new to Ionic creator; looking for tutorial/help to use cordova for location and camera; when I click code settings, I dont see option to add ngCorodova to the project

Understanding how to use ionic-native with Creator
Use cordova barcode generator plugin in ionic creator
Mark position in Google Maps (and update it)

Forget ngCordova, use Ionic-Native instead - its the upgrade from ngCordova. You can find documentations for Ionic-Native here.

Create a new js file in your project named “ionic-native.min.js”. Copy the contents from here into that file. Then go to “CODE SETTINGS >> ANGULAR MODULES” and add “ionic.native” in the Angular Modules dialogue.

Add the camera and location plugin you wanna use by adding “cordova-plugin-camera” and “cordova-plugin-geolocation” in “CODE SETTINGS >> CORDOVA PLUGINS” and you are set to go.

You may have to add “$cordovaGeolocation” in your page controller i.e. “function ($scope, $stateParams, $cordovaGeolocation) {…”

Sample for Geo-location:

Create a button in your page and add Angular Directives: ng-click=“GetLocation()” to the button,
Add a para on the page with content: My Latitude: {{MyLocation.Lat}}
My Longtitude: {{MyLocation.Long}}

Add code in page controller to get your current location:

function ($scope, $stateParams, $cordovaGeolocation) {
    $scope.MyLocation = {
    $scope.GetLocation = function() {
        var posOptions = {timeout: 10000, enableHighAccuracy: false};
            .then(function (position) {
                $scope.MyLocation.Lat  = position.coords.latitude;
                $scope.MyLocation.Long = position.coords.longitude;
            }, function(err) {
          // error

How to access to the phone photo gallery?
How to implement cordova geolocation to posts in ionic creator to get distance?

Hey thank you for the reply. i was also having the same question as i am new to mobile development and i am going directly to ionic creator (so i have a bit confuse here and there). But i love your explanation. It gives me overview about how to work with ionic native, and the code works flawlessly :smiley:



I’ve just followed the instructions exactly as per the above, to the letter, and then when I go to preview the app, in Ionic Creator, I’m confronted with a blank display and the console log reports:

Uncaught TypeError: angular.module(...).config(...) is not a function
Uncaught Error: [$injector:modulerr] Failed to instantiate module app due to:
Error: [$injector:modulerr] Failed to instantiate module ionic.native due to:
Error: [$injector:nomod] Module 'ionic.native' 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.$injector/nomod?p0=ionic.native

Can anyone help me figure this out? I suspect I must be missing something somewhere. Is there something really basic - implicit - within the instructions that I’ve missed?


Make sure you have ionic.native.min.js in your project
Under Angular modules make sure ‘ionic.native’ is included
my app seems to be working


Thanks. Yes, both the .js and the module have been added via the interface.

I think I must be missing something really simple?

Can you confirm that your ionic.native.min.js begins as shown below? I have tried it both with and without the ‘pro forma’ that Creator inserts when you add a .js – and expect that this might be something to do with the error? Also, have you added anything to directives.js or services.js in relation to the above?

Thanks for your help.

/* !!! IMPORTANT: Rename "mymodule" below and add your module to Angular Modules above. */

angular.module('ionic.native', [])

/* Ex.: 

.service('BlankService', [function(){



!function e(n,t,o){function r(l,a){if(!t[l]){if(!n[l]){var c="function"==typeof require&&require;if(!a&&c)return c(l,!0);if(i)return i(l,!0);var


I’ve just exported the application as a package (.apk) and loaded it onto my own android device and the functionality (displaying lat/lng) works great.

I’m guessing the ‘Preview’ within Creator simply can’t deal with anything too ‘custom’ like this? I had read the caveats as implying that while the functionality would not be available in the ‘Preview’, that it would still be possible to ‘preview’ the app.


Awesome answer thank you very much. I have a question for you. I’ve looked at the cordova documentation for these plugins and some things match up, however the scripts you’ve written here are slightly different. how did you know to code it like that , when it differs from the documentation script ? I’m new to creator and things operate different to when I was coding in android studio. sorry for dumb question.thank you in advance.


Glad my answer helped. I just noticed a typo in my original post where it says
"ionic-native.min.js" (with a hypen), it should instead be
"ionic.native.min.js" (with a period).

Which documentation script are you referring to?

#10 , this documentation.

I must say, for some reason , even with the typo my script works like a charm .


would it be appropriate to ask if you could help with some other scripts aswell ? would like to know how to incorporate other plugins, like being able to sign on your screen, write image to a database ( im using sheetsu, but would prefer mysql ) accessing camera and exporting to pdf. in the meantime i was hoping to be able to use your method above for other plugins, seems it could be easy


Just post your questions.

  1. will the cordova plugins work with the creator online preview ? for instance I’ve run the camera plugin but it does nothing, however the geolocation does work.

  2. my app works perfectly but when exported to apk, its a white screen. whats the best way of debugging this issue

I’ve kind of figured out how the plugins work but cant test as the white screen is killing me, I can’t find the error.


Most plugins will not work on the online preview. Native Plugins are meant
to access the native features of your mobile device.

I use chrome to debug apk builds. instructions can be found here:


Suggest you start new topics for different types of questions.


Thank you , I will look into it now thanks a mil. once I get the white screen sorted I will let you know my progress on the camera plugin. have you had any success getting a signature/draw plugin for people to sign on their screens ? I can’t seem to find a cordova / ionic native plugin that can be incorporated into creator.


signature/draw plugin - I haven’t tried or looked for such a plugin. Let me know if you find something. I am sure it will come in handy :slight_smile:


the three I found, where signature pad looks the best, but on all three I have absolutely NO idea how to incorporate it in creator. any ideas ?


I’ve come right with cordova plugins. i wanted to ask you, ive setup sheetsu, writing data to that sheet. it wont write the base64 image from the camera, it gives an internal error, however console.log shows it does capture the string. any ideas on how i can get this working, or should I rather go the route of setting up a php / mysql database ?


have you tried firebase? may be better fitted for the job.