fh-wfm-camera

0.0.10 • Public • Published

FeedHenry WFM Camera Build Status

This module provides client services :

  • A promise based wrapper around the window.navigator.camera.getPicture
  • A desktop and a mobile Angular Service to use the camera module
  • An Angular Directive

Client-side usage

Client-side usage (via broswerify)

Setup

This module is packaged in a CommonJS format, exporting the name of the Angular namespace. The module can be included in an angular.js as follows:

angular.module('app', [
, require('fh-wfm-camera')
...
])

Integration

Angular service
controller('FileListCtrl', function($window, mobileCamera, desktopCamera) {
 
  var captureThenUpload = function() {
    if ($window.cordova) {
      return mobileCamera.capture()
      .then(function(capture) {
        console.log(capture.fileURI);
        console.log(capture.filename);
      })
    } else {
      return desktopCamera.capture()
      .then(function(dataUrl) {
        //do stuff
      })
    }
  }
}

For a more complete example, please check the demo mobile app.

Directives

Name Attributes
camera model, autostart

Readme

Keywords

none

Package Sidebar

Install

npm i fh-wfm-camera

Weekly Downloads

6

Version

0.0.10

License

MIT

Last publish

Collaborators

  • feedhenry
  • feedhenry-dev
  • grdryn