Angular.js + Faye
Faye client wrapper for angular
Example
CoffeeScript
app = angularmodule'myapp''faye' appfactory 'Faye''$faye' $faye"http://localhost:9292/faye" # set faye url in one place = # Publish Fayepublish"/channel-1"msg: "hello" # Subscribe $scope.data = Fayesubscribe "/channel-2" $scopedatapush msg # Get just once (using $q - promise) $scope.data = Fayeget"/channel-3"
Configure Faye client
appfactory 'Faye''$faye' $faye "http://localhost:9292/faye"retry: 5 clientdisable"websocket"
Development
npm installgrunt watch
Testing
node ./build/server.js
- Modify test/test.coffee.
- Open test/index.html.
- You should see executed events in console.
Contributing
- 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