From 4a114203638fbc34fe729f92c3f53d626029694a Mon Sep 17 00:00:00 2001 From: Felix Schuchmann Date: Tue, 21 Jun 2016 04:52:40 +0200 Subject: [PATCH] fix problem when using webpack (#83) * fix problem when using webpack Fixed issue #82 * Update angular-websocket.js --- dist/angular-websocket.js | 4 ++-- src/angular-websocket.js | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/dist/angular-websocket.js b/dist/angular-websocket.js index b2317cd..db99c8e 100644 --- a/dist/angular-websocket.js +++ b/dist/angular-websocket.js @@ -33,7 +33,7 @@ var Socket; - if ((typeof exports === 'undefined' ? 'undefined' : _typeof(exports)) === 'object' && typeof require === 'function') { + if (typeof window === 'undefined') { try { Socket = ws.Client || ws.client || ws; @@ -412,4 +412,4 @@ exports.default = _angular2.default.module('ngWebSocket'); module.exports = exports['default']; -}); \ No newline at end of file +}); diff --git a/src/angular-websocket.js b/src/angular-websocket.js index 7f2c9dd..3f4e919 100644 --- a/src/angular-websocket.js +++ b/src/angular-websocket.js @@ -2,7 +2,7 @@ import angular from 'angular'; var Socket; -if (typeof exports === 'object' && typeof require === 'function') { +if (typeof window === 'undefined') { try { var ws = require('ws');