No commit activity in last 3 years
No release in over 3 years
Angular + Faye, packaged for Rails assets pipeline
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
 Dependencies

Development

~> 1.3
>= 0

Runtime

 Project Readme

Angular.js + Faye

Usage

Add the following to your gemfile:

gem "angular-faye-rails"

Add the following directive to your Javascript manifest file (application.js):

//= require angular-faye

Add the following to your HTML layout

<%= javascript_include_tag "http://localhost:9292/faye/client.js" %>

Example

CoffeeScript

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")

Configure Faye client

app.factory 'Faye', ['$faye', ($faye) ->
  $faye "http://localhost:9292/faye", (client) ->
    client.disable("websocket")
]

Contributing

  1. Fork it
  2. Create your feature branch (git checkout -b my-new-feature)
  3. Commit your changes (git commit -am 'Add some feature')
  4. Push to the branch (git push origin my-new-feature)
  5. Create new Pull Request