angular-sails

An angular module for using the sails socket.io api
Homepage:
5 people use it
Author: Fbb82394e50fa1c4d066d6f76fb14e09?d=https%3a%2f%2fidenticons.github.com%2f401706904823edbd59f11320e279146c kyjan

Angular Sails

This small module allows you to use Sails.JS's awesome socket.io api with AngularJS.

Just add a dependency to your module and controllers and get it going!

Install it:

Usage

A small example:

API Refenrence

Sails.JS REST

Angular Sails wraps the native sails.js REST functions. For further information check out the sails docs and Mike's Screencast

reconnect(url, options)

Angular Sails connects to the current URL by default. Sometimes you need to connect your socket to another URL. You can reconnect your socket connection like this: javascript $sails.reconnect('http://foobar.com:1338');

disconnect()

A wrapper for the socket.io disconnect function. javascript $sails.disconnect();

emit(event, data)

A wrapper for socket.io's emit function. javascript $sails.emit('something very cool', { foo: 'bar' });

comments powered by Disqus
This page was last updated about 3 years ago.