From ad88fcb45efbc4894a3f5faa2a44adcd8b9dd649 Mon Sep 17 00:00:00 2001 From: moscoquera Date: Sun, 3 Jul 2016 10:04:53 -0500 Subject: [PATCH 1/2] Update angular2-websocket.js dont jsonify sended data --- angular2-websocket.js | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/angular2-websocket.js b/angular2-websocket.js index 298ef0a..99df094 100644 --- a/angular2-websocket.js +++ b/angular2-websocket.js @@ -98,7 +98,7 @@ var $WebSocket = (function () { $WebSocket.prototype.fireQueue = function () { while (this.sendQueue.length && this.socket.readyState === this.readyStateConstants.OPEN) { var data = this.sendQueue.shift(); - this.socket.send(lang_1.isString(data.message) ? data.message : JSON.stringify(data.message)); + this.socket.send(data.message); } }; $WebSocket.prototype.notifyCloseCallbacks = function (event) { @@ -206,4 +206,4 @@ var $WebSocket = (function () { return $WebSocket; }()); exports.$WebSocket = $WebSocket; -//# sourceMappingURL=angular2-websocket.js.map \ No newline at end of file +//# sourceMappingURL=angular2-websocket.js.map From 779b1f7ed8e6833304ce3aed8131af0285d93977 Mon Sep 17 00:00:00 2001 From: moscoquera Date: Mon, 4 Jul 2016 10:08:44 -0500 Subject: [PATCH 2/2] Update angular2-websocket.ts removed the json cast in firequeue, allowing send any kind of data. --- src/angular2-websocket.ts | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/angular2-websocket.ts b/src/angular2-websocket.ts index 4039968..1a01c91 100644 --- a/src/angular2-websocket.ts +++ b/src/angular2-websocket.ts @@ -98,9 +98,7 @@ export class $WebSocket { while (this.sendQueue.length && this.socket.readyState === this.readyStateConstants.OPEN) { var data = this.sendQueue.shift(); - this.socket.send( - isString(data.message) ? data.message : JSON.stringify(data.message) - ); + this.socket.send(data.message); // data.deferred.resolve(); } }