ionic tutorial - Cordova ionic | Ionic Cordova Integration - ionic - ionic development - ionic 2 - ionic framework



  • Apache Cordova (formerly PhoneGap) is a mobile application development framework originally created by Nitobi.
  • Adobe Systems purchased Nitobi in 2011, rebranded it as PhoneGap, and later released an open source version of the software called Apache Cordova.
  • Cordova offers ngCordova which is set of wrappers specifically designed to work with AngularJS.
 ionic cordova integration

Installing ngCordova

  • When you start Ionic app you will notice that it is using bower. It can be used for managing ngCordova plugins.
  • If you have bower installed skip this step, if you don't then you can install it in command prompt window.
C:\Users\Username\Desktop\MyApp> npm install -g bower
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team
  • Now we need to install ngCordova. Open your app in command prompt window.
  • Example below is used for the app that is located on desktop and named MyApp
C:\Users\Username\Desktop\MyApp> bower install ngCordova 
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team
  • Next we need to include ngCordova to our app. Open index.html file and add the following scripts.
  • It is important to add these scripts before cordova.js and after ionic scripts.
<script src = "lib/ngCordova/dist/ng-cordova.js"></script>
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team
  • Now we need to inject ngCordova as angular dependency. Open your app.js file and add the ngCordova to angular module.
  • If you used one of the Ionic template apps, you will notice that there are already injected ionic, controllers and services. In that case you will just add ngCordova at the and of array.
angular.module('myApp', ['ngCordova'])
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team
  • You can always check the plugins that are already installed by typing −
C:\Users\Username\Desktop\MyApp> cordova plugins ls
Click below button to copy the code. From wikitechy - ionic tutorial - ionic framework tutorial - team
  • Now we can use Cordova plugins. In our next tutorials we will show you how to use some of the most popular plugins. You can check all of the plugins here

Related Searches to Cordova ionic | Ionic Cordova Integration