An open API service indexing awesome lists of open source software.

https://github.com/danielkov/angular-wsocket.io-service

Angular service for wsocket.io for seemless integration.
https://github.com/danielkov/angular-wsocket.io-service

Last synced: about 1 year ago
JSON representation

Angular service for wsocket.io for seemless integration.

Awesome Lists containing this project

README

          

# WSocket.io Angular Service

The easiest way to integrate wsocket.io into your AngularJS project.

## Browser support

This only supports browsers that come with WebSocket enabled. It has a polyfill for `String.prototype.startsWith()`.

## Simple use

```js
angular.module('myApp', ['angularWsocketIOService'])

.controller('MyController', ['$scope', 'WsocketIOService', function ($scope, WsocketIOService) {
$scope.currentMessage = '';
$scope.response = '';

WsocketIOService.connect();

$scope.sendMessage = function () {
WsocketIOService.send('message', {msg: $scope.currentMessage});
}

WsocketIOService.on('message-back', function (data) {
$scope.response = data.msg;
})
}]);
```