ngCordova is a JS library that acts as an Angular wrapper to all Cordova plugins. Angular has its own architectural style and hence Cordova plugins do not fit directly into an Ionic App. ngCordova makes it super easy for Ionic developers to call JS methods for Cordova plugins and process the data input.
ngCordova is available as a JS file, which can be added to your project using Bower if it is being used as a dependency management system. The bower
command to install the specific ngCordova dependency into your Ionic App is as follows:
$ bower install ngCordova
The ngCordova JS file can also be directly downloaded from the GitHub website, https://github.com/driftyco/ng-cordova/. There will be two files in the dist
folder, ng-cordova.js
and ng-cordova.min.js
. You can include the reference to one of these files in the index.html
file of your Ionic App using the following code:
<script src="lib/ngCordova/dist/ng-cordova.min.js"> <script src="cordova...