ngFeathers 🐦
⚠️ Still WIP: API is unstable and might change.
Installation
Install via Bower:
bower install --save ng-feathers
Add standalone version (dependencies included) to your HTML file
Or add Socket.io + Feathers-Client + (minified) ngFeathers individually:
Install via npm:
npm install --save ng-feathers
Add standalone version (dependencies included) to your HTML file
Or add Socket.io + Feathers-Client + (minified) ngFeathers individually:
REST
- REST requires jQuery as it depends on jQuery's AJAX implementation
Usage (with Socket.io)
// Add ngFeathers as dependencyangular // Optionally configure $feathersProvider
Provider-API
$feathersProvider.setAuthStorage(newAuthStorage:Object)
(default:window.localStorage
)$feathersProvider.setSocketOpts(opts:Object)
(optional)$feathersProvider.useSocket(socketEnabled:Boolean)
(default:true
)$feathersProvider.setEndpoint(newEndpoint:String)
FeatherJS Docs)
Service-Functions (stolen from the officialfind({query: {attr: 'value'}})
: Retrieves a list of all matching resources from the serviceget(id, {query: {fetch: 'all'}})
: Retrieve a single resource from the service.create({"text": "Example"})
: Create a new resource with data which may also be an array.update(id, {"text": "Example"})
: Completely replace a single or multiple resources.- ProTip: update is normally expected to replace an entire resource which is why the database adapters only support patch for multiple records.
patch(id, {"text": "Example"})
: Merge the existing data of a single or multiple resources with the new data.remove(id)
: Remove a single or multiple resources: