Skip to content

kmillerdevx3/availity-angular

 
 

Repository files navigation

availity-angular

Availity Angular SDK

License Bower Dependency Status Build

Table of Contents

Intro

Directory Layout
.
├── /dist/                      # Assets ready for distribution
├── /node_modules/              # 3rd-party libraries and utilities
├── /docs/                      # SDK documentation and samples
├── /gulp/                      # Gulp tasks and utility classes
│── gulpfile.js                 # Configuration file for automated builds
│── bower.json                  # Bower list of 3rd party libraries
└── package.json                # NPM list of 3rd party libraries and utilities


## Demo
[http://demo.availity.com/public/apps/availity-angular](http://demo.availity.com/public/apps/availity-angular)


## Supported Browsers

* Internet Explorer 8 and newer
* Google Chrome (latest version)
* Mozilla Firefox (latest version)

> Other browsers should be supported as well but you may experience some issues.


## Quickstart
Install the Availity Angular SDK with Bower.

>
```bash
$ bower install availity-angular --save

Angular

Core Module

The module availity are Angular services and utilities for building web applications. These include:

Asynchronous Requests & Responses

Not all Availity Rest services support asynchronous requests/responses. Please check the documentation at https://developer.availity.com for support.

Angular API Rest services created from api-factory.js have been enhanced to support Availity Rest asynchronous requests. In essence, if api-factory.js detects an asynchronous response, it will automatically poll Availity Rest services for the real response for about 30 seconds. The default starting poll interval is 1 second with a decay factor of 1.2. If a proper response isn't received with in the max interval polling time the Angular ajax promise will get rejected. This behavior is transparent to users of Angular services that have been extended from api-factory.js.

As the contract changes between the client and server for async request/response, api-factory.js will be updated accordingly.

Usage
  • Create a new API Resource
var restServiceResource = new AvApiResource('/some/rest/path');
  • Server responds with asynchronous payload with Status Code: 202 OK with the location header set
access-control-allow-origin:*
cache-control:public, max-age=0
connection:keep-alive
content-encoding:gzip
content-type:application/json
date:Sat, 04 Apr 2015 14:16:13 GMT
etag:W/"b27-3834658027"
last-modified:Tue, 31 Mar 2015 17:54:52 GMT
transfer-encoding:chunked
vary:Origin, Accept-Encoding
# Aries rest response with # Header with ping URL
Location: http://localhost:3000/some/rest/path
  • Use the API service with optional notification callback
restServiceResource.query().then(function(successResponse) {
  // success code goes here :)
}, function(errorResponse){
  // error code goes here :(
}, function(notifyResponse) {
  // notification response contains the json data with poll information
});
  • Override polling interval options per request
restServiceResource.query({
    pollingInterval: 2000,
    pollingMaxInterval: 10,
    pollingDecay: 1.8
}).then(function(successResponse) {
  // success code goes here :)
}, function(errorResponse){
  // error code goes here :(
}, function(notifyResponse) {
  // notification response contains the json data with poll information
});
  • Specify cache busting per request
restServiceResource.query({
    cacheBust: true
}).then(function(successResponse) {
  // success code goes here :)
}, function(errorResponse){
  // error code goes here :(
}, function(notifyResponse) {
  // notification response contains the json data with poll information
});

UI Module

The module availity.ui is a set of Angular services and directive wrappers around jQuery plugins. These include:

Acknowledgments

The Availity Angular lib was heavily inspired by multiple open source frameworks. If for some reason a library could not be used directly (IE8 limitation), we've reused that projects code directly in this project. Please check out the libs below for some beautifully written code.

Authors

Robert McGuinness

Bobby Bennett

Javier Fernandez-Ivern

Danny Noler

License

Copyright (c) 2015 Availity, LLC

Packages

No packages published

Languages

  • JavaScript 82.6%
  • HTML 17.1%
  • CSS 0.3%