angularjs-shoe
An angularjs module that enables you to use shoe websocket streaming in the browser with angularjs.
This module wraps the shoe
library so that any $scope
mutations are
correctly wrapped with $rootScope.$apply
calls so model changes are
instantly reflected in the view.
Installation
npm
If you're using browserify then install via npm:
$ npm install angularjs-shoe
and require angularjs-shoe
in your browserify
code:
;
bower
If you're using bower then install using the bower command line:
$ bower install angularjs-shoe
Old school
If you just want to use the client library without a package manager then
simply include the build/angularjs-bower.js
or
build/angularjs-bower.min.js
file into your HTML:
Example<!-- AngularJS needs to be included before --><!-- Then you can include the angularjs-shoe module from your project --><!-- Then your regular angular code -->
Using angularjs-shoe from your AngularJS controllers
To use shoe from your controllers you simply define eugeneware.shoe
as a module dependency for your app and then you can use dependency injection
to refer to the shoe
or reconnect
variables:
// client.jsvar app = angular;app;
If you want to use shoe
and have it automatically reconnect to the
websocket
server when there is a network disconnection then use the
reconnect
function:
// client.jsvar app = angular;app;
Notes
The browser files build/angularjs-shoe.js
and build/angularjs-shoe.min.js
already have shoe
and reconnect
bundled with them so you don't need
to include them yourself.