A RainCatcher AppForm module for FeedHenry RainCatcher. This module provides :
- A set of AngularJS directives
- An AngularJS Service to interact with AppForms.
- A backend Service to interact with AppForms
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-appform')
...
])This module provides a injectable file service : appformClient
This client offers these functions :
initlistgetFormgetSubmissionLocalgetSubmissiongetSubmissionsgetFieldscreateSubmissionsubmitSubmissionuploadSubmissioncomposeSubmissionResultsyncStepResultwatchSubmissionModel
Example of getForm usage :
resolve: {
form: function($stateParams, appformClient) {
return appformClient.getForm($stateParams.formId);
}
}For a more complete example around files operations, please check the demo portal app.
The following field types are currently supported:
- Text
- Number
- Location
- Photo
Additional field type support will be added in future.
| Name | Attributes |
|---|---|
| appformSubmission | submissionLocalId, submissionId, submission |
| appform | form, formId |
| appformField | field, model |
| appformFieldLocation | field, model |
| appformFieldPhoto | field, model |
| appformFieldNumber | field, model |
| appformFieldDatetime | field, model |
| appformFieldDate | field, model |
| appformFieldTime | field, model |
The server-side component of this RainCatcher module exports a function that takes express and mediator instances as parameters, as in:
var express = require('express')
, mbaasApi = require('fh-mbaas-api')
, app = express()
, mbaasExpress = mbaasApi.mbaasExpress()
, mediator = require('fh-wfm-mediator/lib/mediator')
;
// configure the express app
...
// setup the wfm user router
require('fh-wfm-appform/lib/server')(mbaasApi);This module will subscribe to the the submissionEventListener and react on these events :
submissionStartedsubmissionComplete