|
@@ -29,6 +29,7 @@ angular.module('chatServices', [])
|
|
chatSocket = new WS(jsRoutes.controllers.Application.chat(username).webSocketURL());
|
|
chatSocket = new WS(jsRoutes.controllers.Application.chat(username).webSocketURL());
|
|
chatSocket.onmessage = wrap(function(event) {
|
|
chatSocket.onmessage = wrap(function(event) {
|
|
var message = JSON.parse(event.data);
|
|
var message = JSON.parse(event.data);
|
|
|
|
+ console.log(message);
|
|
if(message.kind != "pong") {
|
|
if(message.kind != "pong") {
|
|
$rootScope.$broadcast('ws:message', message);
|
|
$rootScope.$broadcast('ws:message', message);
|
|
}
|
|
}
|
|
@@ -72,6 +73,8 @@ angular.module('chatServices', [])
|
|
}
|
|
}
|
|
service.messages.push(message);
|
|
service.messages.push(message);
|
|
},
|
|
},
|
|
|
|
+ connect: Connection.connect,
|
|
|
|
+ disconnect: Connection.disconnect,
|
|
isConnected: Connection.isConnected,
|
|
isConnected: Connection.isConnected,
|
|
send: Connection.send
|
|
send: Connection.send
|
|
};
|
|
};
|