We will discuss a few important plugins that are required in most of the apps. These plugins are available for both iOS and Android, but we will discuss the common JS code here as the native code is abstracted from the developer.
This plugin enables taking pictures and videos from the camera using your Ionic App and saving it to the local storage. This is available in the ngCordova module as the $cordovaCamera
service. We have to use dependency injection to inject this service to any controller or service we want to use this in.
The command line to be executed using the Ionic/Cordova CLI is:
cordova plugin add cordova-plugin-camera
The $cordovaCamera
service exposes one method getPicture(options)
to invoke the native camera API. The object options passed to this method define the settings and the behavior of the action to be completed from the app. The options parameter is passed as an object containing the following optional properties/fields:
Options property... |
---|