Faye client wrapper for angular
app = angular.module('myapp', ['faye'])
app.factory 'Faye', ['$faye', ($faye) ->
$faye("http://localhost:9292/faye") # set faye url in one place
]
@TestCtrl = ($scope, $http, Faye) ->
# Publish
Faye.publish("/channel-1", {msg: "hello"})
# Subscribe
$scope.data = []
Faye.subscribe "/channel-2", (msg) ->
$scope.data.push msg
# Get just once (using $q - promise)
$scope.data = Faye.get("/channel-3")
app.factory 'Faye', ['$faye', ($faye) ->
$faye "http://localhost:9292/faye", {retry: 5}, (client) ->
client.disable("websocket")
]
npm install
grunt watch
node ./build/server.js
- Modify test/test.coffee.
- Open test/index.html.
- You should see executed events in console.
- Fork it
- Create your feature branch (
git checkout -b my-new-feature
) - Commit your changes (
git commit -am 'Add some feature'
) - Push to the branch (
git push origin my-new-feature
) - Create new Pull Request