Angular Module to manage your failed requests.
This module is focused on mobile development, specially for phonegap apps (or any HTML5 / Javascript framework) that you build using angular.
Although you can use it for any web app in which you get missing server errors, or any case that suits you.
This module will help you to:
- Store failed requests when mobile devices lose connection
- Keep your app running as if nothing has happened and retry all your failed HTTP Requests later (when your app is loaded again)
In order to keep your app running correctly, you should manage error cases as them will be passed to your http requests, that is, you have to control http error responses and keep them hidden to make believe the user everything went right and improve the user experience of your app. This means user won't have unwanted stops or halts using your app.
As this repository is focused to help manage failed requets these features are planned to be added soon:
- Management of resolving failed requests
- Resolving time (currently failed requests are retried when the app reloads).
- Filters to catch desired requests by path.
- Some other ideas that come as this project goes on...
Suggestions are welcome.
Here you can see this module in action
This module requires my key-value-storage module in order to work. You'll need ngCookies for this module to work.
Add "ngCookies" and "failedRequestsManager" to your app modules list, and corresponding scripts to your HTML:
angular.module('MyApp', [ ... , 'FailedRequestsHandler', 'ngCookies' ])
<script type="application/javascript" src="lib/angular/angular-cookies.min.js"></script>
<script type="application/javascript" src="lib/key-value-storage/key-value-storage.js"></script>
<script type="application/javascript" src="lib/failed-requests/failed-requests-handler.js"></script>
KeyValueStorage module is added by FailedRequestsHandler module in your app definition, although, you have to add the script in your html.
Currently, by adding the 'failedRequestsHandler' module, all your non-read HTTP Requests which have failed will be stored. Automatically, when your app loads again, this module will retry the stored requests.