Fetching latest commit…
Cannot retrieve the latest commit at this time.
Permalink
Type Name Latest commit message Commit time
..
Failed to load latest commit information.
dist
lib
.eslintrc
.gitignore
Gruntfile.js
README.md
package.json

README.md

Example Gallery Step

This step exemplifies the utilization of the @raincatcher/camera and @raincatcher/filestorage-client modules in a custom step that can take multiple pictures as part of its execution flow.

Specifiying camera options

In order to supply options for the underlying cordova camera plugin, supply a function that edits the default options and returns the updated version of the intended configuration:

var galleryStep = require('@raincatcher/step-gallery');
// add thestep as a dependency of the mobile app
angular.module('wfm-mobile', [
  //...
  galleryStep.ngModule($fh, function buildOptions(camera) {
    return  {
      'quality': 20,
      // camera is the cordova plugin Camera object
      'destinationType': camera.DestinationType.FILE_URI,
      'sourceType': camera.PictureSourceType.CAMERA,
      'encodingType': camera.EncodingType.JPEG,
      'mediaType': camera.MediaType.PICTURE,
      'allowEdit': false,
      'correctOrientation': true
    };
  }, "user");
]);

The returned options are merged with the default ones in @raincatcher/camera, and the above values display the defaults.