poc(websockets): websocket poc

This commit is contained in:
Torkel Ödegaard
2016-03-03 23:05:08 +01:00
parent 1049824014
commit fc877ae0f4
5 changed files with 176 additions and 2 deletions

View File

@@ -19,7 +19,16 @@ class AdminSettingsCtrl {
class AdminHomeCtrl {
/** @ngInject **/
constructor() {}
constructor() {
var conn = new WebSocket("ws://localhost:3000/ws");
conn.onclose = function(evt) {
console.log("Connection closed");
};
conn.onmessage = function(evt) {
console.log("message", evt.data);
};
}
}
export class AdminStatsCtrl {