Skip to content

Instantly share code, notes, and snippets.

@jroxendal
jroxendal / gist:5327191
Last active December 15, 2015 21:39
A meditation on angular websocket services in coffescript.
myModule.factory 'websocket', ($q) ->
# to run, inject thus:
# myModule.run (websocket) ->
# websocket.connect("ws://localhost:8000")
# websocket.on "myCommand", (data) ->
# c.log "data received!", data
# websocket.send "my outgoing message"