abl-sdk-feathers
About
ABL's client-side API middleware based on the Feathers.js client. The following modules are included:
- feathers-client as
$abl
global - feathers-hooks
- feathers-rest
- feathers-socketio
- feathers-reactive returns all service methods as RxJS observables that automatically update on real-time events.
Usage
Reference the minified scripts in index.html:
Specify the abl-sdk-feathers module as a dependency of your AngularJS application:
var app = angular;
Configure the $ablProvider service
app;
AngularJS
Inject the $abl service into any controller, service or directive where you need it:
app;
React
The abl-sdk-feathers instance is accessible via the global variable $abl
so usage is exactly the same:
{ // As a Promise $ablservicesactivities ; // As an Observable $ablservicesactivities ); }
Services
Services are the heart of every Feathers application and JavaScript objects (or instances of ES6 classes) that implements certain methods. Feathers itself will also add some additional methods and functionality to its services.
See the Feathers.js services documentation for more detail.
Service methods
Service methods are pre-defined CRUD methods that your service object can implement. Below is a complete example of the Feathers service interface:
const myService = {} {} {} {} {} {} {} $abl;
Or as an ES6 class:
'use strict'; {} {} {} {} {} {} {} $abl;
Querying
See the Feathers.js querying documentation for more detail.
// Find all unread messages in room #2$abl;
GET /messages?read=false&roomId=2
Utilities
$abl.showToast(message, cssClass, duration)
Launch an Angular Material toast with an optional CSS class and display duration:
$abl;
$abl;
Developing
To work with the code, just run:
npm install && gulp
Build
gulp build