@blinkmobile/angularjs-pending-queue v1.0.0-alpha.2
AngularJS Pending Queue 
AngularJS 1.5+ module to save form data to the browser or device storage when there is no connectivity or a server error
Installation
npm i @blinkmobile/angularjs-pending-queueSetup
- Include
dist/bm-angularjs-pending-queue.jsordist/bm-angularjs-pending-queue.min.jsin your HTML or in your build step - Add
bmPendingQueueas a dependency to your AngularJS web app
require('path/to/dist/bm-angularjs-pending-queue.min.js')
angular.module('myModule', ['bmPendingQueue'])Injectables
pendingQueueList- Component that displays the items saved in the pending queuebmPendingQueueService- Service that wraps LocalForage to save data to the device in a specific format. Broadcasts events on$rootScopedbName- Constant. The name of the device storage db being usedpendingQueueTable- Constant. The name of the table in the db
How it works
AngularJS Pending Queue works by injecting a HTTP Interceptor into the interceptors array. If a POST or PUT request with a Content Type header of application/x-www-form-urlencoded or application/json errors, the request and response data is saved to the device storage using LocalForage. If a previously saved item is successfully sent, the corresponding entry in device storage is removed.
There is a decorator for the $http service, to automate resending of items in the pending queue. Any successful HTTP request will trigger resending of any items in the pending queue.
See the docs folder for more details
9 years ago
9 years ago