api-angular
A package wrapping @av/api-core with Angular $http
.
Install
npm install @availity/api-angular @availity/api-core @availity/localstorage-core --save
Usage
import availityApi from '@availity/api-angular';
angular.module('app', [availityApi]);
Inject one of the predefined API classes in a controller or service:
app.service('myCustomService', avUsersApi => {
return avUsersApi.me();
});
API Definitions
The services below can be injected into other services or controllers
avApiOptions
AvMicroserviceApi
avLogMessagesApi
AvProxyApi
avWebQLApi
avPdfApi
avNavigationApi
avNotificationApi
avOrganizationsApi
avPermissionsApi
avProvidersApi
avRegionsApi
avSpacesApi
avUsersApi
avUserPermissionsApi
avFilesApi
avFilesDeliverApi
avSettingsApi
avCodesApi
Details about each api can be found here
app.service(
'myCustomService',
(
avPdfApi,
avNavigationApi,
avNotificationApi,
avOrganizationsApi,
avPermissionsApi,
avProvidersApi,
AvProxyApi,
avRegionsApi,
avSpacesApi,
avUsersApi,
avUserPermissionsApi
) => {
}
);
Options
Configure the default options:
config(avApiOptionsProvider => {
avApiOptionsProvider.setOptions({
version: 'v2',
});
});
Create API Definitions
Create API definitions by extending AvApi
. Extending AvApi
provides services the behaviors described in @api-core/README#features
function factory(AvApi) {
class AvExampleResource extends AvApi {
constructor() {
super({
name: 'exampleApi',
});
}
}
return new AvExampleResource();
}
Create Proxy API Definitions
Create proxy API definitions by extending AvApiProxy
. Extending AvApiProxy
provides services the behaviors described in @api-core/README#features as well as building the url to match your tenant's proxy REST conventions.
function factory(AvApiProxy) {
class AvExampleResource extends AvApiProxy {
constructor() {
super({
tenant: 'myhealthplan',
name: 'patients',
});
}
}
return new AvExampleResource();
}