slively/dpd-angular-cache — pull request #3 by andreialecu (2014-12-22 15:47:40+00:00)
Title: Add socket.io and make caching optional

Hey,

I needed an angular module for dpd and found yours, however, I also needed socket.io support for it, and didn't really need caching.

So I added socket.io and made caching configurable. I also made it possible to specify a different server where the API resides which was important for me.

Additionally I fixed some of the white space issues which is why the diff seems so big.

The changes should be backwards compatible, but it adds new configuration options like:

```
app.value('dpdConfig', {
collections: ['categories'],
serverRoot: 'http://someotherserver.com/', // optional, defaults to same server
socketOptions: { reconnectionDelayMax: 3000 }, // optional socket io additional configuration
useSocketIo: true // optional, defaults to false
noCache: true // optional, defaults to false (false means that caching is enabled, true that it isn't)
});
```

The socket.io additions can be used like:

```
app.controller('bodyController',function($scope, dpd){
dpd.categories.on("changed", function (result) { // this handles "categories:changed"
}
// or
dpd.socket.on("categories:changed", function (result) {
}
}
```

Let me know if there are any issues.