Ecosyste.ms: Awesome

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

Awesome Lists | Featured Topics | Projects

https://github.com/ethanhann/eeh-signalr

AngularJS wrapper module for the official jQuery SignalR library.
https://github.com/ethanhann/eeh-signalr

angular angularjs angularjs-wrapper eeh-signalr javascript signalr

Last synced: about 1 month ago
JSON representation

AngularJS wrapper module for the official jQuery SignalR library.

Awesome Lists containing this project

README

        

# eeh-signalr
AngularJS wrapper module for the official jQuery SignalR client.

## Usage

### (Optional) Configure the SignalR URL

The URL is '/signalr' by default.
If it is set to another value on the server, or if CORS is in use, it can be set when you configure your app.

```js
angular.module('myApp').config(function (eehSignalRProvider) {
eehSignalRProvider.url('http://example.com/myCustomSignalRUrl');
});
```

### Inject the eehSignalR Service in a Controller (or somewhere else)

```js
angular.module('myApp')
.controller('MainCtrl', function ($scope, eehSignalR) {
var hub = eehSignalR.getHub('assetHub');
hub.client.hello = function (message) {
$scope.message = message;
$scope.$apply();
};
eehSignalR.start();
});
```