flowthings-angular-client
Install
NPM
npm install flowthings-angular
Bower
bower install flowthings-angular
Dependencies:
Example
angular ;
Configuration
flowthingsProvider.options
account
token
WebSockets
flowthings.ws.connect()
Initiates a WebSocket connection. Returns a Promise.
flowthings.ws.subscribe(flowIdOrPath, callback[, scope])
Subscribes to the provided Flow and invokes the callback when receiving Drops. Providing a scope will tie the subscription to the scope's lifecycle, automatically unsubscribing when the scope is destroyed.
Returns a record of { unsubscribe: function, result: Promise }
flowthings.ws.send(command)
Sends arbitrary commands through the WebSocket API. Returns a Promise with the response.
REST
flowthings.flow.read(flowId[, params])
flowthings.flow.findMany(params)
flowthings.flow.find(...)
flowthings.drop.create(drop)
flowthings.drop(flowId).create(drop)
flowthings.drop(flowId).update(drop)
flowthings.drop(flowId).save(...)
flowthings.drop(flowId).read(dropId[, params])
flowthings.drop(flowId).findMany(params)
flowthings.drop(flowId).find(...)
flowthings.drop(flowId).aggregate(spec[, params])
Aggregation spec options:
filter
groupBy
rules
output
sorts
Please visit the flowthings.io aggregation documentation for more details on how to use these options.
Events
flowthings:open
Broadcasted when a WebSocket connection opens. Returns the WebSocket client.
flowthings:error
Broadcasted when a WebSocket connection errors. Returns nothing.
flowthings:close
Broadcasted when a WebSocket connection closes. Returns WebSocket event object.